Notification Manager
Types
Link copied to clipboard
interface NotificationBuilder
Provide your NotificationBuilder in the NotificationCustomizationOptions when initializing the SDK via setNotificationCustomizationOptions.
Link copied to clipboard
interface NotificationChannelIdProvider
Provide your NotificationChannelIdProvider in the NotificationCustomizationOptions when initializing the SDK via setNotificationCustomizationOptions.
Link copied to clipboard
interface NotificationLaunchIntentProvider
Provide your NotificationLaunchIntentProvider in the NotificationCustomizationOptions when initializing the SDK via setNotificationCustomizationOptions.
Link copied to clipboard
interface NotificationMessageDisplayedListener
Link copied to clipboard
interface ShouldShowNotificationListener
Properties
Link copied to clipboard
The channel id of the default notification channel created be the SDK.
Link copied to clipboard
val DEFAULT_FOREGROUND_CHANNEL_ID: String = "com.salesforce.marketingcloud.DEFAULT_FOREGROUND_CHANNEL"
The channel id of the default foreground notification channel created be the SDK.
Functions
Link copied to clipboard
Returns whether or not notifications are enabled.
Link copied to clipboard
open fun cancelNotificationMessage(@NonNull context: Context, @NonNull message: NotificationMessage)
Will cancel the notification associated with the provided message.
Link copied to clipboard
Will create the default notification channel used by the SDK only if it does not already exist.
open fun createDefaultNotificationChannel(@NonNull context: Context, forceRecreate: Boolean): String
Will create the default notification channel used by the SDK.
Link copied to clipboard
Will create the foreground notification channel used by the SDK only if it does not already exist.
Link copied to clipboard
Disables notifications in the SDK.
Link copied to clipboard
Enables notifications in the SDK.
Link copied to clipboard
Extracts the NotificationMessage from the Intent.
Link copied to clipboard
open fun getDefaultNotificationBuilder(@NonNull context: Context, @NonNull message: NotificationMessage, @NonNull channelId: String, @DrawableRes smallIconResId: Int): NotificationCompat.Builder
This method will build out a androidx.core.app.NotificationCompat.Builder with the defaults typically used by the SDK.
Link copied to clipboard
open fun redirectIntentForAnalytics(@NonNull context: Context, @NonNull openIntent: PendingIntent, @NonNull message: RemoteMessage, autoCancel: Boolean): PendingIntent
open fun redirectIntentForAnalytics(@NonNull context: Context, @NonNull openIntent: PendingIntent, @NonNull message: NotificationMessage, autoCancel: Boolean): PendingIntent
Returns a PendingIntent that will redirect to our internal Service to handle notification opened analytics.
Link copied to clipboard
abstract fun registerNotificationMessageDisplayedListener(@NonNull listener: NotificationManager.NotificationMessageDisplayedListener)
Registers the provided listener.
Link copied to clipboard
abstract fun setShouldShowNotificationListener(@Nullable listener: NotificationManager.ShouldShowNotificationListener)
Set a Should Show Notification Listener that will be queried as to whether or not a given notification should be displayed by the SDK.
Link copied to clipboard
abstract fun unregisterNotificationMessageDisplayedListener(@NonNull listener: NotificationManager.NotificationMessageDisplayedListener)
Unregisters the provided listener.