createDefaultNotificationChannel

fun createDefaultNotificationChannel(context: Context, forceRecreate: Boolean): String

Will create the default notification channel used by the SDK.

The channel is created with Notification.VISIBILITY_PRIVATE. On Android 8+ that value is the lock-screen ceiling for every notification posted to this channel. NotificationMessage.Visibility.PUBLIC from the payload will not show full lock-screen content unless the app provides its own Notification.VISIBILITY_PUBLIC channel via NotificationChannelIdProvider. Channel visibility cannot be changed after creation; forceRecreate only refreshes the localized name, it does not raise visibility for existing installs.

Return

The channel id of the created notification channel.

Parameters

context

Context

forceRecreate

If true, the SDK will create the channel even if it already exists. If you have provided localization for the SDK's channel name R.string.mcsdk_default_notification_channel_name then you will need to pass true when the user changes the language on their device.

See also


fun createDefaultNotificationChannel(context: Context): String

Will create the default notification channel used by the SDK only if it does not already exist.

Return

The channel id of the created notification channel.

Parameters

context

Context