Interface GCMMessage.Builder

    • Method Detail

      • action

        GCMMessage.Builder action​(String 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.

        Parameters:
        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.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Action, Action
      • action

        GCMMessage.Builder action​(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.

        Parameters:
        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.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Action, Action
      • body

        GCMMessage.Builder body​(String body)

        The body of the notification message.

        Parameters:
        body - The body of the notification message.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • collapseKey

        GCMMessage.Builder collapseKey​(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.

        Parameters:
        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:
        Returns a reference to this object so that method calls can be chained together.
      • data

        GCMMessage.Builder data​(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.

        Parameters:
        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.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • iconReference

        GCMMessage.Builder iconReference​(String iconReference)

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

        Parameters:
        iconReference - The icon image name of the asset saved in your app.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • imageIconUrl

        GCMMessage.Builder imageIconUrl​(String imageIconUrl)

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

        Parameters:
        imageIconUrl - The URL of the large icon image to display in the content view of the push notification.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • imageUrl

        GCMMessage.Builder imageUrl​(String imageUrl)

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

        Parameters:
        imageUrl - The URL of an image to display in the push notification.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • preferredAuthenticationMethod

        GCMMessage.Builder preferredAuthenticationMethod​(String preferredAuthenticationMethod)

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

        Parameters:
        preferredAuthenticationMethod - The preferred authentication method, with valid values "KEY" or "TOKEN". If a value isn't provided then the DefaultAuthenticationMethod is used.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • priority

        GCMMessage.Builder priority​(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.

Parameters:
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:
    Returns a reference to this object so that method calls can be chained together.