Package com.eatthepath.pushy.apns
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 TypeMethodDescriptionReturns the ID assigned to this push notification by the APNs server.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 orfalse
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
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 bygetApnsId()
.- 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
Returns the reason for rejection reported by the APNs gateway. If the notification was accepted, the rejection reason will benull
.- Returns:
- the reason for rejection reported by the APNs gateway, or empty if the notification was not rejected
- Since:
- 0.5
-
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:
-