How to Override Notification Intents
The SDK provides two different ways that you can override the default intent when someone taps on a push message received by your Android app:
- Change the screen that opens when the user taps the notification.
- Change the screen that opens based on custom logic, such as: if message A, go here; if message B go somewhere else.
To change the screen that opens when a user taps the notification, use
MarketingCloudConfig.builder()and set the activity.
To use custom logic to determine which screen opens, provide your implementation of NotificationManager.NotificationLaunchIntentProvider when configuring the SDK using MarketingCloudConfig.Builder. Create and return the PendingIntent for the notification’s destination.
When using NotificationManager.NotificationLaunchIntentProvider, the value provided when calling MarketingCloudConfig$Builder.setNotificationRecipient will be ignored.
If you return a null intent, users still receive the notification, but nothing happens when they tap it. If you return a null notification builder, you won’t get any analytics for this notification.