handleNotification

open suspend override fun handleNotification(eventType: String?, eventBody: String?)

Function to pass a received the notification data payload instance to the SDK in order to adjust the SDK state accordingly. This function should be called from FirebaseMessagingService.onMessageReceived(remoteMessage: RemoteMessage)

Example usage:

val eventType = message.data["yp-type"]
val eventData = message.data["yp-event"]
try {
sdk.handleNotification(eventType = eventType, eventBody = eventData)
} catch (e: WhitelabelPayError.WrongNotificationType) {
Timber.e(e)
} catch (e: WhitelabelPayError.InvalidNotificationBody) {
Timber.e(e)
}

Parameters

eventType

the string value of the yp-type data payload key

eventBody

the string value of the yp-event data payload key

Throws