Interface ApnsPushNotification

All Known Implementing Classes:
SimpleApnsPushNotification

public interface ApnsPushNotification

A push notification that can be sent through the Apple Push Notification service (APNs). Push notifications have a token that identifies the device to which it should be sent, a topic (generally the bundle ID of the receiving app), a JSON payload, and (optionally) a time at which the notification is invalid and should no longer be delivered.

Push notifications may also include a unique identifier that will be echoed in responses from the APNs server. If no identifier is provided, the server will assign an identifier automatically.

Since:
0.1
Author:
Jon Chambers
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the canonical identifier for this push notification.
    Returns an optional identifier for this notification that allows this notification to supersede previous notifications or to be superseded by later notifications with the same identifier.
    Returns the time at which Apple's push notification service should stop trying to deliver this push notification.
    Returns the JSON-encoded payload of this push notification.
    Returns the priority with which this push notification should be sent to the receiving device.
    Returns the display type this push notification.
    Returns the token of the device to which this push notification is to be sent.
    Returns the topic to which this notification should be sent.
  • Method Details

    • getToken

      String getToken()
      Returns the token of the device to which this push notification is to be sent.
      Returns:
      a string of hexadecimal digits representing the token of the device to which this push notification is to be sent
      Since:
      0.5
    • getPayload

      String getPayload()
      Returns the JSON-encoded payload of this push notification.
      Returns:
      the JSON-encoded payload of this push notification
      Since:
      0.1
    • getExpiration

      Instant getExpiration()
      Returns the time at which Apple's push notification service should stop trying to deliver this push notification. If null, the push notification service will not attempt to store the notification at all. Note that APNs will only store one notification per device token for re-delivery at a time.
      Returns:
      the time at which this notification can be discarded
      Since:
      0.5
    • getPriority

      DeliveryPriority getPriority()
      Returns the priority with which this push notification should be sent to the receiving device. If null, an immediate delivery priority is assumed.
      Returns:
      the priority with which this push notification should be sent to the receiving device
      Since:
      0.4
    • getPushType

      PushType getPushType()
      Returns the display type this push notification. Note that push notification display types are required in iOS 13 and later and watchOS 6 and later, but are ignored under earlier versions of either operating system. May be null.
      Returns:
      the display type this push notification
      Since:
      0.13.9
    • getTopic

      String getTopic()
      Returns the topic to which this notification should be sent. This is generally the bundle ID of the receiving app. Topics must not be null.
      Returns:
      the topic to which this notification should be sent; must not be null
      Since:
      0.5
    • getCollapseId

      String getCollapseId()
      Returns an optional identifier for this notification that allows this notification to supersede previous notifications or to be superseded by later notifications with the same identifier.
      Returns:
      an identifier for this notification; may be null
      Since:
      0.8.1
    • getApnsId

      UUID getApnsId()
      Returns the canonical identifier for this push notification. The APNs server will include the given identifier in all responses related to this push notification. If no identifier is provided, the server will assign a unique identifier automatically.
      Returns:
      a unique identifier for this notification; may be null, in which case the APNs server will assign an identifier automatically