|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavapns.notification.PushedNotification
public class PushedNotification
An object representing the result of a push notification to a specific payload to a single device.
If any error occurred while trying to push the notification, an exception is attached.
If Apple's Push Notification Service returned an error-response packet, it is linked to the related PushedNotification so you can find out what the actual error was.
Constructor Summary | |
---|---|
PushedNotification(Device device,
Payload payload,
Exception exception)
|
Method Summary | |
---|---|
static List<PushedNotification> |
findFailedNotifications(List<PushedNotification> notifications)
Filters a list of pushed notifications and returns only the ones that failed. |
static List<PushedNotification> |
findSuccessfulNotifications(List<PushedNotification> notifications)
Filters a list of pushed notifications and returns only the ones that were successful. |
Device |
getDevice()
Returns the device that the payload was pushed to. |
Exception |
getException()
Get the exception that occurred while trying to push this notification, if any. |
long |
getExpiry()
Returns the expiration date of the push notification. |
int |
getIdentifier()
Returns the connection-unique identifier referred to by error-response packets. |
String |
getLatestTransmissionAttempt()
Returns a human-friendly description of the number of attempts made to transmit the notification. |
Payload |
getPayload()
Returns the payload that was pushed. |
ResponsePacket |
getResponse()
If a response packet regarding this notification was received, this method returns it. |
int |
getTransmissionAttempts()
Returns the number of attempts that have been made to transmit the notification. |
boolean |
isSuccessful()
Returns true if no response packet was received for this notification, or if one was received but is not an error-response (ie command 8), or if one was received but its status is 0 (no error occurred). |
boolean |
isTransmissionCompleted()
Indicates if the notification has been streamed successfully to Apple's server. |
String |
toString()
Returns a human-friendly description of this pushed notification. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PushedNotification(Device device, Payload payload, Exception exception)
Method Detail |
---|
public Payload getPayload()
public Device getDevice()
public int getIdentifier()
public long getExpiry()
public int getTransmissionAttempts()
public String getLatestTransmissionAttempt()
public boolean isTransmissionCompleted()
public ResponsePacket getResponse()
public boolean isSuccessful()
Returns true if no response packet was received for this notification, or if one was received but is not an error-response (ie command 8), or if one was received but its status is 0 (no error occurred).
Returns false if an error-response packet is attached and has a non-zero status code.
Returns false if an exception is attached.
Make sure you use the Feedback Service to cleanup your list of invalid device tokens, as Apple's documentation says.
public static List<PushedNotification> findSuccessfulNotifications(List<PushedNotification> notifications)
notifications
- a list of pushed notifications
public static List<PushedNotification> findFailedNotifications(List<PushedNotification> notifications)
notifications
- a list of pushed notifications
public String toString()
toString
in class Object
public Exception getException()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |