-
public class PushNotifications
Public entry point to use push notifications with zendesk.android.messaging.Messaging.
-
-
Field Summary
Fields Modifier and Type Field Description public final static PushNotifications
INSTANCE
-
Method Summary
Modifier and Type Method Description final static Unit
updatePushNotificationToken(String pushNotificationToken)
Updates the pushNotificationToken associated with this device to receive push notifications. final static PushResponsibility
shouldBeDisplayed(Map<String, String> messageData)
When receiving a push notification payload, this method can be used to check if it belongs to Messaging and if it can be displayed. final static Unit
displayNotification(Context context, Map<String, String> messageData)
Displays the given messageData as a push notification in the system tray if the push belongs to Messaging and the SDK is able to display it. final static Unit
setNotificationSmallIconId(@DrawableRes() Integer smallIconId)
Sets the DrawableRes ID to be used as a small icon in push notifications. -
-
Method Detail
-
updatePushNotificationToken
final static Unit updatePushNotificationToken(String pushNotificationToken)
Updates the pushNotificationToken associated with this device to receive push notifications.
This function can be called at any time. The pushNotificationToken is only be updated once a zendesk.conversationkit.android.model.User becomes available. If one was not available when this method was called, then the SDK will defer the update automatically.
- Parameters:
pushNotificationToken
- the device token for receiving push notifications
-
shouldBeDisplayed
final static PushResponsibility shouldBeDisplayed(Map<String, String> messageData)
When receiving a push notification payload, this method can be used to check if it belongs to Messaging and if it can be displayed.
- Parameters:
messageData
- the data received from the push notification
-
displayNotification
final static Unit displayNotification(Context context, Map<String, String> messageData)
Displays the given messageData as a push notification in the system tray if the push belongs to Messaging and the SDK is able to display it.
If the message doesn't belong to Messaging or the SDK is unable to display the message then this method will return early, without displaying the push notification.
-
setNotificationSmallIconId
final static Unit setNotificationSmallIconId(@DrawableRes() Integer smallIconId)
Sets the DrawableRes ID to be used as a small icon in push notifications. Passing a null value will reset the icon ID back to the default value.
- Parameters:
smallIconId
- the DrawableRes ID of the drawable to be used as the small icon
-
-
-
-