|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ApnsService
Represents the connection and interface to the Apple APNS servers.
The service is created by ApnsServiceBuilder like:
ApnsService = APNS.newService()
.withCert("/path/to/certificate.p12", "MyCertPassword")
.withSandboxDestination()
.build()
| Method Summary | |
|---|---|
Map<String,Date> |
getInactiveDevices()
Returns the list of devices that reported failed-delivery attempts to the Apple Feedback services. |
void |
push(ApnsNotification message)
Sends the provided notification message to the desired
destination. |
ApnsNotification |
push(byte[] deviceToken,
byte[] payload)
Sends a push notification with the provided payload to the
iPhone of deviceToken. |
EnhancedApnsNotification |
push(byte[] deviceToken,
byte[] payload,
int expiry)
|
Collection<? extends ApnsNotification> |
push(Collection<byte[]> deviceTokens,
byte[] payload)
Sends a bulk push notification with the provided payload to iPhone of deviceTokens set. |
Collection<? extends EnhancedApnsNotification> |
push(Collection<byte[]> deviceTokens,
byte[] payload,
int expiry)
|
Collection<? extends ApnsNotification> |
push(Collection<String> deviceTokens,
String payload)
Sends a bulk push notification with the provided payload to iPhone of deviceTokens set. |
Collection<? extends EnhancedApnsNotification> |
push(Collection<String> deviceTokens,
String payload,
Date expiry)
|
ApnsNotification |
push(String deviceToken,
String payload)
Sends a push notification with the provided payload to the
iPhone of deviceToken. |
EnhancedApnsNotification |
push(String deviceToken,
String payload,
Date expiry)
|
void |
start()
Starts the service. |
void |
stop()
Stops the service and frees any allocated resources it created for this service. |
void |
testConnection()
Test that the service is setup properly and the Apple servers are reachable. |
| Method Detail |
|---|
ApnsNotification push(String deviceToken,
String payload)
throws NetworkIOException
payload to the
iPhone of deviceToken.
The payload needs to be a valid JSON object, otherwise it may fail
silently. It is recommended to use PayloadBuilder to create
one.
deviceToken - the destination iPhone device tokenpayload - The payload message
NetworkIOException - if a network error occured while
attempting to send the message
EnhancedApnsNotification push(String deviceToken,
String payload,
Date expiry)
throws NetworkIOException
NetworkIOException
ApnsNotification push(byte[] deviceToken,
byte[] payload)
throws NetworkIOException
payload to the
iPhone of deviceToken.
The payload needs to be a valid JSON object, otherwise it may fail
silently. It is recommended to use PayloadBuilder to create
one.
deviceToken - the destination iPhone device tokenpayload - The payload message
NetworkIOException - if a network error occurred while
attempting to send the message
EnhancedApnsNotification push(byte[] deviceToken,
byte[] payload,
int expiry)
throws NetworkIOException
NetworkIOException
Collection<? extends ApnsNotification> push(Collection<String> deviceTokens,
String payload)
throws NetworkIOException
payload to iPhone of deviceTokens set.
The payload needs to be a valid JSON object, otherwise it may fail
silently. It is recommended to use PayloadBuilder to create
one.
deviceTokens - the destination iPhone device tokenspayload - The payload message
NetworkIOException - if a network error occurred while
attempting to send the message
Collection<? extends EnhancedApnsNotification> push(Collection<String> deviceTokens,
String payload,
Date expiry)
throws NetworkIOException
NetworkIOException
Collection<? extends ApnsNotification> push(Collection<byte[]> deviceTokens,
byte[] payload)
throws NetworkIOException
payload to iPhone of deviceTokens set.
The payload needs to be a valid JSON object, otherwise it may fail
silently. It is recommended to use PayloadBuilder to create
one.
deviceTokens - the destination iPhone device tokenspayload - The payload message
NetworkIOException - if a network error occurred while
attempting to send the message
Collection<? extends EnhancedApnsNotification> push(Collection<byte[]> deviceTokens,
byte[] payload,
int expiry)
throws NetworkIOException
NetworkIOException
void push(ApnsNotification message)
throws NetworkIOException
message to the desired
destination.
NetworkIOException - if a network error occured while
attempting to send the messagevoid start()
NetworkIOException - if a network error occurred while
starting the servicevoid stop()
Map<String,Date> getInactiveDevices()
throws NetworkIOException
NetworkIOException - if a network error occurred
while retrieving invalid device connection
void testConnection()
throws NetworkIOException
NetworkIOException - if the Apple servers aren't reachable
or the service cannot send notifications for now
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||