Class GCMMessage

    • Method Detail

      • action

        public final Action action()

        The action to occur if the recipient taps the push notification. Valid values are:

        • OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.

        • DEEP_LINK - Your app opens and displays a designated user interface in the app. This action uses the deep-linking features of the Android platform.

        • URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.

        If the service returns an enum value that is not available in the current SDK version, action will return Action.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from actionAsString().

        Returns:
        The action to occur if the recipient taps the push notification. Valid values are:

        • OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.

        • DEEP_LINK - Your app opens and displays a designated user interface in the app. This action uses the deep-linking features of the Android platform.

        • URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.

        See Also:
        Action
      • actionAsString

        public final String actionAsString()

        The action to occur if the recipient taps the push notification. Valid values are:

        • OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.

        • DEEP_LINK - Your app opens and displays a designated user interface in the app. This action uses the deep-linking features of the Android platform.

        • URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.

        If the service returns an enum value that is not available in the current SDK version, action will return Action.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from actionAsString().

        Returns:
        The action to occur if the recipient taps the push notification. Valid values are:

        • OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.

        • DEEP_LINK - Your app opens and displays a designated user interface in the app. This action uses the deep-linking features of the Android platform.

        • URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.

        See Also:
        Action
      • body

        public final String body()

        The body of the notification message.

        Returns:
        The body of the notification message.
      • collapseKey

        public final String collapseKey()

        An arbitrary string that identifies a group of messages that can be collapsed to ensure that only the last message is sent when delivery can resume. This helps avoid sending too many instances of the same messages when the recipient's device comes online again or becomes active.

        Amazon Pinpoint specifies this value in the Firebase Cloud Messaging (FCM) collapse_key parameter when it sends the notification message to FCM.

        Returns:
        An arbitrary string that identifies a group of messages that can be collapsed to ensure that only the last message is sent when delivery can resume. This helps avoid sending too many instances of the same messages when the recipient's device comes online again or becomes active.

        Amazon Pinpoint specifies this value in the Firebase Cloud Messaging (FCM) collapse_key parameter when it sends the notification message to FCM.

      • hasData

        public final boolean hasData()
        For responses, this returns true if the service returned a value for the Data property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • data

        public final Map<String,​String> data()

        The JSON data payload to use for the push notification, if the notification is a silent push notification. This payload is added to the data.pinpoint.jsonBody object of the notification.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasData() method.

        Returns:
        The JSON data payload to use for the push notification, if the notification is a silent push notification. This payload is added to the data.pinpoint.jsonBody object of the notification.
      • iconReference

        public final String iconReference()

        The icon image name of the asset saved in your app.

        Returns:
        The icon image name of the asset saved in your app.
      • imageIconUrl

        public final String imageIconUrl()

        The URL of the large icon image to display in the content view of the push notification.

        Returns:
        The URL of the large icon image to display in the content view of the push notification.
      • imageUrl

        public final String imageUrl()

        The URL of an image to display in the push notification.

        Returns:
        The URL of an image to display in the push notification.
      • preferredAuthenticationMethod

        public final String preferredAuthenticationMethod()

        The preferred authentication method, with valid values "KEY" or "TOKEN". If a value isn't provided then the DefaultAuthenticationMethod is used.

        Returns:
        The preferred authentication method, with valid values "KEY" or "TOKEN". If a value isn't provided then the DefaultAuthenticationMethod is used.
      • priority

        public final String priority()

        para>normal – The notification might be delayed. Delivery is optimized for battery usage on the recipient's device. Use this value unless immediate delivery is required.

        /listitem>
      • high – The notification is sent immediately and might wake a sleeping device.

      • /para>

        Amazon Pinpoint specifies this value in the FCM priority parameter when it sends the notification message to FCM.

        The equivalent values for Apple Push Notification service (APNs) are 5, for normal, and 10, for high. If you specify an APNs value for this property, Amazon Pinpoint accepts and converts the value to the corresponding FCM value.

Returns:
para>normal – The notification might be delayed. Delivery is optimized for battery usage on the recipient's device. Use this value unless immediate delivery is required.

/listitem>
  • high – The notification is sent immediately and might wake a sleeping device.

  • /para>

    Amazon Pinpoint specifies this value in the FCM priority parameter when it sends the notification message to FCM.

    The equivalent values for Apple Push Notification service (APNs) are 5, for normal, and 10, for high. If you specify an APNs value for this property, Amazon Pinpoint accepts and converts the value to the corresponding FCM value.