public class ApnsServiceImpl extends Object
| Constructor and Description |
|---|
ApnsServiceImpl(ApnsConnection connection,
ApnsFeedbackConnection feedback) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Date> |
getInactiveDevices()
Returns the list of devices that reported failed-delivery
attempts to the Apple Feedback services.
|
void |
push(ApnsNotification msg)
Sends the provided notification
message to the desired
destination. |
EnhancedApnsNotification |
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<EnhancedApnsNotification> |
push(Collection<byte[]> deviceTokens,
byte[] payload)
Sends a bulk push notification with the provided
payload to iPhone of deviceTokens set. |
Collection<EnhancedApnsNotification> |
push(Collection<byte[]> deviceTokens,
byte[] payload,
int expiry) |
Collection<EnhancedApnsNotification> |
push(Collection<String> deviceTokens,
String payload)
Sends a bulk push notification with the provided
payload to iPhone of deviceTokens set. |
Collection<EnhancedApnsNotification> |
push(Collection<String> deviceTokens,
String payload,
Date expiry) |
EnhancedApnsNotification |
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.
|
public ApnsServiceImpl(ApnsConnection connection, ApnsFeedbackConnection feedback)
public void push(ApnsNotification msg) throws NetworkIOException
ApnsServicemessage to the desired
destination.push in interface ApnsServiceNetworkIOException - if a network error occurred while
attempting to send the messagepublic void start()
ApnsServicepublic void stop()
ApnsServicepublic void testConnection()
ApnsServicepublic EnhancedApnsNotification push(String deviceToken, String payload) throws NetworkIOException
ApnsServicepayload 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.push in interface ApnsServicedeviceToken - the destination iPhone device tokenpayload - The payload messageNetworkIOException - if a network error occurred while
attempting to send the messagepublic EnhancedApnsNotification push(String deviceToken, String payload, Date expiry) throws NetworkIOException
push in interface ApnsServiceNetworkIOExceptionpublic EnhancedApnsNotification push(byte[] deviceToken, byte[] payload) throws NetworkIOException
ApnsServicepayload 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.push in interface ApnsServicedeviceToken - the destination iPhone device tokenpayload - The payload messageNetworkIOException - if a network error occurred while
attempting to send the messagepublic EnhancedApnsNotification push(byte[] deviceToken, byte[] payload, int expiry) throws NetworkIOException
push in interface ApnsServiceNetworkIOExceptionpublic Collection<EnhancedApnsNotification> push(Collection<String> deviceTokens, String payload) throws NetworkIOException
ApnsServicepayload 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.push in interface ApnsServicedeviceTokens - the destination iPhone device tokenspayload - The payload messageNetworkIOException - if a network error occurred while
attempting to send the messagepublic Collection<EnhancedApnsNotification> push(Collection<String> deviceTokens, String payload, Date expiry) throws NetworkIOException
push in interface ApnsServiceNetworkIOExceptionpublic Collection<EnhancedApnsNotification> push(Collection<byte[]> deviceTokens, byte[] payload) throws NetworkIOException
ApnsServicepayload 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.push in interface ApnsServicedeviceTokens - the destination iPhone device tokenspayload - The payload messageNetworkIOException - if a network error occurred while
attempting to send the messagepublic Collection<EnhancedApnsNotification> push(Collection<byte[]> deviceTokens, byte[] payload, int expiry) throws NetworkIOException
push in interface ApnsServiceNetworkIOExceptionpublic Map<String,Date> getInactiveDevices() throws NetworkIOException
ApnsServicegetInactiveDevices in interface ApnsServiceNetworkIOException - if a network error occurred
while retrieving invalid device connectionCopyright © 2015. All rights reserved.