PushMessageListener

open class PushMessageListener(appId: String)

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

Link copied to clipboard
constructor()
constructor(appId: String)

Functions

Link copied to clipboard
open fun customizeNotification(notification: Notification, context: Context, payload: Bundle)

Callback to customise the notification object if required. SDK uses this method to add/customise a few settings like vibration, led color etc. Make sure you call super before adding your own customisation.

Link copied to clipboard
open fun getIntentFlags(payload: Bundle): Int

Get the intent flags for the redirection intent

Link copied to clipboard
open fun handleCustomAction(context: Context, payload: String)

Callback triggered for custom action.

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. In case you are overriding this method ensure you call super(context, payload), notifications will not be shown if super is not called. Note: If the super(context, payload) returns false ensure that the method always returns false.

Link copied to clipboard

Build the notification using NotificationCompat.Builder

Link copied to clipboard
open fun onNotificationCleared(context: Context, payload: Bundle)

Callback triggered when notification is cleared from the device's notification drawer.

Link copied to clipboard
open fun onNotificationClick(activity: Activity, payload: Bundle): Boolean

This method is used to redirect the user to a specific screen or URL on notification click.

Link copied to clipboard
open fun onNotificationReceived(context: Context, payload: Bundle)

Callback triggered whenever notification is received by the application.

Link copied to clipboard

Callback triggered after the notification is shown.