Last active
October 2, 2018 15:08
-
-
Save sfmc-mobilepushsdk/69f3ce1be80000b0b183371a3b1c59ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String channelId = "my_custom_channel"; | |
((android.app.NotificationManager) getSystemService( | |
Context.NOTIFICATION_SERVICE)).createNotificationChannel( | |
new NotificationChannel(channelId, "Marketing Messages", | |
android.app.NotificationManager.IMPORTANCE_DEFAULT)); | |
MarketingCloudSdk.init((Context) this, MarketingCloudConfig.builder() | |
// Other configuration options | |
.setNotificationCustomizationOptions( | |
NotificationCustomizationOptions.create(R.drawable.ic_notification_icon, null, | |
new NotificationManager.NotificationChannelIdProvider() { | |
@Override @NonNull public String getNotificationChannelId(@NonNull Context context, | |
@NonNull NotificationMessage notificationMessage) { | |
// Whatever custom logic required to determine which channel should be used for the message. | |
return channelId; | |
} | |
})).build((Context) this), new MarketingCloudSdk.InitializationListener() { | |
@Override public void complete(@NonNull InitializationStatus status) { | |
// TODO Handle initialization status | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment