processNotification

suspend fun processNotification(messageData: Map<String, Any>): Result<PushNotification?>

Process a push notification message. This method parses the message data and creates a PushNotification object.

Return

A Result containing the PushNotification object (or null if message is invalid) or an Exception in case of failure.

Parameters

messageData

The message data as a Map of Any to String, as typically received from Firebase.


Process a push notification message received as a string. This method parses the string message data (typically a JWT) and creates a PushNotification object.

Return

A Result containing the PushNotification object (or null if message is invalid) or an Exception in case of failure.

Parameters

message

The message data as a String.


suspend fun processNotification(remoteMessage: RemoteMessage): Result<PushNotification?>

Process a push notification message from Firebase Cloud Messaging. This method extracts data from the RemoteMessage and creates a PushNotification object.

Return

A Result containing the PushNotification object (or null if message is invalid) or an Exception in case of failure.

Parameters

remoteMessage

The Firebase RemoteMessage object.