Package 

Object PushNotifications

    • 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.
      • Methods inherited from class zendesk.messaging.android.push.PushNotifications

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.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.

        Parameters:
        context - an instance of Context
        messageData - the data received from the push notification