ProximityNotificationCustomizer

Package: com.salesforce.marketingcloud.notifications

Available since: SDK version 11.0.0 (also available in 10.0.0)

Overview 

An open class that extends NotificationCustomizer for handling proximity-based notifications in the Salesforce Marketing Cloud SDK.

Class Declaration 

1open class ProximityNotificationCustomizer : NotificationCustomizer

Constructors 

ProximityNotificationCustomizer 

1constructor(
2    @NonNull smallIconResId: Int,
3    @Nullable channelIdProvider: NotificationManager.NotificationChannelIdProvider
4)

Creates a new instance of ProximityNotificationCustomizer.

Parameters:

  • smallIconResId - Int (@NonNull) - Resource ID for the notification’s small icon
  • channelIdProvider - NotificationManager.NotificationChannelIdProvider (@Nullable) - Provider for notification channel ID

Methods 

setupNotificationBuilder 

1@NonNull
2open fun setupNotificationBuilder(
3    @NonNull context: Context,
4    @NonNull message: NotificationMessage
5): NotificationCompat.Builder

Provides the Notification Builder to be used when displaying a notification message. Creates and configures the notification builder for displaying messages.

Parameters:

  • context - Context (@NonNull) - Android context
  • message - NotificationMessage (@NonNull) - The notification message to display

Returns:

  • NotificationCompat.Builder (@NonNull) - Configured notification builder

Inheritance Hierarchy 

1NotificationCustomizer
2  └── ProximityNotificationCustomizer

Usage 

This customizer is specifically designed for proximity-based notifications (geofence/beacon messages) in the Marketing Cloud Mobile Push SDK. Extend this class to customize how proximity notifications are displayed to users.

Source: Salesforce Marketing Cloud Android SDK JavaDocs