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

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

Types

Link copied to clipboard
enum Type
Represents payload type.

Functions

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

Properties

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