Push Click Callback
MoEngage’s Flutter plugin optionally provides a callback on push clicks. To register for the callback, call the setPushClickCallbackHandler() on the MoEngageFlutter object in your dart code.This API takes a method as input with whose typedef is PushClickCallbackHandler(PushCampaignData data).
Payload
NotificationPayload received in the callback is anPushCampaignData instance with the following definition:
clickAction.payload - Action payload for the clicked action.
clickedAction.payload.type - Type of navigation action defined. Possible values screenName, deepLink, and richLanding. Currently, in the case of iOS, rich landing and deep-link URLs are processed internally by the SDK and not passed in this callback; therefore possible value in the case of iOS is only screenName.
clickAction.value - value entered for navigation action or custom payload.
clickAction.kvPair - Custom key-value pair entered on the MoEngage Platform.
payload - Complete campaign payload.
Android Payload
If the user clicks on the default content of the notification, the key-value pair and campaign payload can be found inside the payload key. If the user clicks on the action button or a push template action, the action payload would be found inside clickedAction.You can use the isDefaultAction key to check whether the user clicked on the default content and then parse the payload accordingly.