PushMessageListener

open class PushMessageListener

This class is a callback for the push message delivery. In order to modify the behavior simply extend this class and override methods

Since

5.3

Author

Umang Chamaria

Constructors

PushMessageListener
Link copied to clipboard
fun PushMessageListener()

Functions

customizeNotification
Link copied to clipboard
open fun customizeNotification(notification: Notification, context: Context, payload: Bundle)
Callback to customise the notification object if required.
dismissNotificationAfterClick
Link copied to clipboard
fun dismissNotificationAfterClick(context: Context, payload: Bundle)
Forcefully dismisses a Notification posted to the status bar.
getIntentFlags
Link copied to clipboard
open fun getIntentFlags(payload: Bundle): Int
Get the intent flags for the redirection intent
getNotificationId
Link copied to clipboard
fun getNotificationId(context: Context, update: Boolean): Int
getRedirectIntent
Link copied to clipboard
open fun getRedirectIntent(context: Context): Intent
Returns the redirectIntent which will be started from the pending intent of the notification Note: Overriding this method and returning a custom intent will affect click tracking.
handleCustomAction
Link copied to clipboard
open fun handleCustomAction(context: Context?, payload: String)
Callback triggered for custom action.
isNotificationRequired
Link copied to clipboard
open fun isNotificationRequired(context: Context, payload: Bundle): Boolean
Return value of this method decides whether a notification should be shown or not.
logCampaignImpression
Link copied to clipboard
fun logCampaignImpression(context: Context, payload: Bundle)
Logs impression for the notification if it was shown
logNotificationClicked
Link copied to clipboard
fun logNotificationClicked(context: Context?, intent: Intent?)
Tracks notification clicks on MoEngage Platform.
onCreateNotification
Link copied to clipboard
open fun onCreateNotification(context: Context, notificationPayload: NotificationPayload): NotificationCompat.Builder
Build the notification using NotificationCompat.BuilderOverride this method to customise the NotificationCompat.Builder.
onHandleRedirection
Link copied to clipboard
open fun onHandleRedirection(activity: Activity, payload: Bundle)
This method is used to redirect the user to a specific screen or URL on notification click.
onMessageReceived
Link copied to clipboard
fun onMessageReceived(context: Context, payload: Bundle)
Callback which is triggered when a push payload is received.
fun onMessageReceived(context: Context, payloadMap: Map<String, String>)
Callback which is triggered when a push payload is received.
onNonMoEngageMessageReceived
Link copied to clipboard
open fun onNonMoEngageMessageReceived(context: Context, payload: Bundle)
To get a callback for push not sent via MoEngage Platform.
onNotificationCleared
Link copied to clipboard
open fun onNotificationCleared(context: Context, payload: Bundle)
Callback triggered when notification is cleared from the device's notification drawer.
onNotificationNotRequired
Link copied to clipboard
open fun onNotificationNotRequired(context: Context, payload: Bundle)
Callback triggered whenever notification is not shown by the SDK.
onNotificationReceived
Link copied to clipboard
open fun onNotificationReceived(context: Context, payload: Bundle)
Callback triggered whenever notification is received by the application.