NotificationPayload

open class NotificationPayload

Helper accessor for notification data payload bundle as received from Twilio Notifications. Use in FirebaseMessagingService.onMessageReceived implementation to retrieve Twilio-generated payload fields safely.

Do not access the fields in the bundle directly - they could be modified without notice, always use this helper to access them.

Constructors

NotificationPayload
Link copied to clipboard
open fun NotificationPayload(remoteMessage: Map<String, String>)
Create notification payload from the received map.

Types

Type
Link copied to clipboard
enum Type
Represents payload type.

Functions

getAuthor
Link copied to clipboard
open fun getAuthor(): String
Get message author.
getBody
Link copied to clipboard
open fun getBody(): String
Get notification body.
getConversationSid
Link copied to clipboard
open fun getConversationSid(): String
Get notification conversation SID.
getConversationTitle
Link copied to clipboard
open fun getConversationTitle(): String
Get notification conversation title.
getMediaContentType
Link copied to clipboard
open fun getMediaContentType(): String
Get media content type.
getMediaCount
Link copied to clipboard
open fun getMediaCount(): Long
Get number of media attachments.
getMediaFilename
Link copied to clipboard
open fun getMediaFilename(): String
Get media filename.
getMediaSid
Link copied to clipboard
open fun getMediaSid(): String
Get media SID.
getMediaSize
Link copied to clipboard
open fun getMediaSize(): Long
Get media size.
getMessageIndex
Link copied to clipboard
open fun getMessageIndex(): Long
Get message index.
getMessageSid
Link copied to clipboard
open fun getMessageSid(): String
Get message SID.
getSound
Link copied to clipboard
open fun getSound(): String
Get notification sound.
getType
Link copied to clipboard
open fun getType(): NotificationPayload.Type
Get notification type.

Properties

INVALID_MESSAGE_INDEX
Link copied to clipboard
val INVALID_MESSAGE_INDEX: Long
Value returned by getMessageIndex if notification contains no message index.