Interface APNSMessage.Builder

    • Method Detail

      • apnsPushType

        APNSMessage.Builder apnsPushType​(String apnsPushType)

        The type of push notification to send. Valid values are:

        • alert - For a standard notification that's displayed on recipients' devices and prompts a recipient to interact with the notification.

        • background - For a silent notification that delivers content in the background and isn't displayed on recipients' devices.

        • complication - For a notification that contains update information for an app’s complication timeline.

        • fileprovider - For a notification that signals changes to a File Provider extension.

        • mdm - For a notification that tells managed devices to contact the MDM server.

        • voip - For a notification that provides information about an incoming VoIP call.

        Amazon Pinpoint specifies this value in the apns-push-type request header when it sends the notification message to APNs. If you don't specify a value for this property, Amazon Pinpoint sets the value to alert or background automatically, based on the value that you specify for the SilentPush or RawContent property of the message.

        For more information about the apns-push-type request header, see Sending Notification Requests to APNs on the Apple Developer website.

        Parameters:
        apnsPushType - The type of push notification to send. Valid values are:

        • alert - For a standard notification that's displayed on recipients' devices and prompts a recipient to interact with the notification.

        • background - For a silent notification that delivers content in the background and isn't displayed on recipients' devices.

        • complication - For a notification that contains update information for an app’s complication timeline.

        • fileprovider - For a notification that signals changes to a File Provider extension.

        • mdm - For a notification that tells managed devices to contact the MDM server.

        • voip - For a notification that provides information about an incoming VoIP call.

        Amazon Pinpoint specifies this value in the apns-push-type request header when it sends the notification message to APNs. If you don't specify a value for this property, Amazon Pinpoint sets the value to alert or background automatically, based on the value that you specify for the SilentPush or RawContent property of the message.

        For more information about the apns-push-type request header, see Sending Notification Requests to APNs on the Apple Developer website.

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

        APNSMessage.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 setting uses the deep-linking features of the iOS 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 setting uses the deep-linking features of the iOS 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

        APNSMessage.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 setting uses the deep-linking features of the iOS 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 setting uses the deep-linking features of the iOS 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
      • badge

        APNSMessage.Builder badge​(Integer badge)

        The key that indicates whether and how to modify the badge of your app's icon when the recipient receives the push notification. If this key isn't included in the dictionary, the badge doesn't change. To remove the badge, set this value to 0.

        Parameters:
        badge - The key that indicates whether and how to modify the badge of your app's icon when the recipient receives the push notification. If this key isn't included in the dictionary, the badge doesn't change. To remove the badge, set this value to 0.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • body

        APNSMessage.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.
      • category

        APNSMessage.Builder category​(String category)

        The key that indicates the notification type for the push notification. This key is a value that's defined by the identifier property of one of your app's registered categories.

        Parameters:
        category - The key that indicates the notification type for the push notification. This key is a value that's defined by the identifier property of one of your app's registered categories.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • collapseId

        APNSMessage.Builder collapseId​(String collapseId)

        An arbitrary identifier that, if assigned to multiple messages, APNs uses to coalesce the messages into a single push notification instead of delivering each message individually. This value can't exceed 64 bytes.

        Amazon Pinpoint specifies this value in the apns-collapse-id request header when it sends the notification message to APNs.

        Parameters:
        collapseId - An arbitrary identifier that, if assigned to multiple messages, APNs uses to coalesce the messages into a single push notification instead of delivering each message individually. This value can't exceed 64 bytes.

        Amazon Pinpoint specifies this value in the apns-collapse-id request header when it sends the notification message to APNs.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • data

        APNSMessage.Builder data​(Map<String,​String> data)

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

        Parameters:
        data - The JSON payload to use for 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.
      • mediaUrl

        APNSMessage.Builder mediaUrl​(String mediaUrl)

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

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

        APNSMessage.Builder preferredAuthenticationMethod​(String preferredAuthenticationMethod)

        The authentication method that you want Amazon Pinpoint to use when authenticating with APNs, CERTIFICATE or TOKEN.

        Parameters:
        preferredAuthenticationMethod - The authentication method that you want Amazon Pinpoint to use when authenticating with APNs, CERTIFICATE or TOKEN.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • priority

        APNSMessage.Builder priority​(String priority)

        para>5 - Low priority, the notification might be delayed, delivered as part of a group, or throttled.

        /listitem>
      • 10 - High priority, the notification is sent immediately. This is the default value. A high priority notification should trigger an alert, play a sound, or badge your app's icon on the recipient's device.

      • /para>

        Amazon Pinpoint specifies this value in the apns-priority request header when it sends the notification message to APNs.

        The equivalent values for Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), are normal, for 5, and high, for 10. If you specify an FCM value for this property, Amazon Pinpoint accepts and converts the value to the corresponding APNs value.

Parameters:
priority - para>5 - Low priority, the notification might be delayed, delivered as part of a group, or throttled.

/listitem>
  • 10 - High priority, the notification is sent immediately. This is the default value. A high priority notification should trigger an alert, play a sound, or badge your app's icon on the recipient's device.

  • /para>

    Amazon Pinpoint specifies this value in the apns-priority request header when it sends the notification message to APNs.

    The equivalent values for Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), are normal, for 5, and high, for 10. If you specify an FCM value for this property, Amazon Pinpoint accepts and converts the value to the corresponding APNs value.

    Returns:
    Returns a reference to this object so that method calls can be chained together.