Chat Android SDK
5.1.0
|
Helper accessor for notification data payload bundle as received from Twilio Notifications. More...
Classes | |
enum | Type |
Represents payload type. More... | |
Public Member Functions | |
NotificationPayload (Bundle data) | |
Create notification payload from the received bundle. More... | |
NotificationPayload (Map< String, String > remoteMessage) | |
Create notification payload from the received map. More... | |
Getters | |
Type | getType () |
Get notification type. More... | |
String | getAuthor () |
Get NEW_MESSAGE notification author. More... | |
String | getBody () |
Get NEW_MESSAGE notification body. More... | |
String | getChannelTitle () |
Get NEW_MESSAGE notification channel title. More... | |
String | getChannelSid () |
Get NEW_MESSAGE notification channel SID. More... | |
String | getMessageSid () |
Get NEW_MESSAGE notification message SID. More... | |
String | getSound () |
Get notification sound. More... | |
Helper accessor for notification data payload bundle as received from Twilio Notifications.
Use in GcmListener.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.
com.twilio.chat.NotificationPayload.NotificationPayload | ( | Bundle | data | ) |
Create notification payload from the received bundle.
data | Android Bundle with push notification data as received from the system. |
Example:
com.twilio.chat.NotificationPayload.NotificationPayload | ( | Map< String, String > | remoteMessage | ) |
Create notification payload from the received map.
remoteMessage | Android FCM RemoteMessage with push notification data as received from the system. |
Example:
String com.twilio.chat.NotificationPayload.getAuthor | ( | ) |
Get NEW_MESSAGE notification author.
String com.twilio.chat.NotificationPayload.getBody | ( | ) |
Get NEW_MESSAGE notification body.
String com.twilio.chat.NotificationPayload.getChannelSid | ( | ) |
Get NEW_MESSAGE notification channel SID.
String com.twilio.chat.NotificationPayload.getChannelTitle | ( | ) |
Get NEW_MESSAGE notification channel title.
String com.twilio.chat.NotificationPayload.getMessageSid | ( | ) |
Get NEW_MESSAGE notification message SID.
String com.twilio.chat.NotificationPayload.getSound | ( | ) |
Get notification sound.