Interface PushNotificationResponse<T extends ApnsPushNotification>

Type Parameters:
T - the type of push notification

public interface PushNotificationResponse<T extends ApnsPushNotification>
A response from the APNs gateway indicating whether a notification was accepted or rejected.
Since:
0.5
Author:
Jon Chambers
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the ID assigned to this push notification by the APNs server.
    default Optional<UUID>
    Returns a unique identifier set by the APNs server in development environments to facilitate testing notifications.
    Returns the original push notification sent to the APNs gateway.
    Returns the reason for rejection reported by the APNs gateway.
    int
    Returns the HTTP status code reported by the APNs server.
    If the sent push notification was rejected because the destination token is no longer valid, returns "the time at which APNs confirmed the token was no longer valid for the topic." Callers should stop attempting to send notifications to the expired token unless the token has been re-registered more recently than the returned timestamp.
    boolean
    Indicates whether the push notification was accepted by the APNs gateway.
  • Method Details

    • getPushNotification

      T getPushNotification()
      Returns the original push notification sent to the APNs gateway.
      Returns:
      the original push notification sent to the APNs gateway
      Since:
      0.5
    • isAccepted

      boolean isAccepted()
      Indicates whether the push notification was accepted by the APNs gateway.
      Returns:
      true if the push notification was accepted or false if it was rejected
      Since:
      0.5
    • getApnsId

      UUID getApnsId()
      Returns the ID assigned to this push notification by the APNs server.
      Returns:
      the ID assigned to this push notification by the APNs server
    • getApnsUniqueId

      default Optional<UUID> getApnsUniqueId()
      Returns a unique identifier set by the APNs server in development environments to facilitate testing notifications. Note that this identifier is distinct from the identifier returned by getApnsId().
      Returns:
      the unique identifier assigned by the APNs server to the sent notification if the server is in the APNs development environment or empty if the server is in the production environment and did not include a unique identifier
      See Also:
    • getStatusCode

      int getStatusCode()
      Returns the HTTP status code reported by the APNs server.
      Returns:
      the HTTP status code reported by the APNs server
      Since:
      0.15.0
    • getRejectionReason

      Optional<String> getRejectionReason()
      Returns the reason for rejection reported by the APNs gateway. If the notification was accepted, the rejection reason will be null.
      Returns:
      the reason for rejection reported by the APNs gateway, or empty if the notification was not rejected
      Since:
      0.5
    • getTokenInvalidationTimestamp

      Optional<Instant> getTokenInvalidationTimestamp()
      If the sent push notification was rejected because the destination token is no longer valid, returns "the time at which APNs confirmed the token was no longer valid for the topic." Callers should stop attempting to send notifications to the expired token unless the token has been re-registered more recently than the returned timestamp.
      Returns:
      the time at which APNs confirmed the token was no longer valid for the given topic, or empty if the push notification was either accepted or rejected for a reason other than token invalidation
      Since:
      0.5
      See Also: