onNotificationClick

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.

IS_DEFAULT_ACTION is a key in the payload which can be used to identify whether the user clicked on the default content(or Default Action on MoEngage Platform).

If true the user has clicked on the default action and the key-value pair entered on the MoEngage platform would be present at the root level of the Bundle If false the user has clicked on the Action Button in the notification or clicked on a push template. In this case the associated can be fetched from NAV_ACTION. The value of this key is a Parcelable. You get the action payload using the below code.

val action = payload.getParcelable(NAV_ACTION) as NavigationAction?

Refer to NavigationAction to know more about the action payload.

Parameters

activity

instance of Activity

payload

push payload