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
    UUID getApnsId()
    Returns the ID assigned to this push notification by the APNs server.
    T getPushNotification()
    Returns the original push notification sent to the APNs gateway.
    String getRejectionReason()
    Returns the reason for rejection reported by the APNs gateway.
    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.
    boolean isAccepted()
    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
    • getRejectionReason

      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 null 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:
      Sending Notification Requests to APNs