public class QueuedApnsService extends Object
Constructor and Description |
---|
QueuedApnsService(ApnsService service) |
QueuedApnsService(ApnsService service,
ThreadFactory tf) |
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 deviceToken s 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 deviceToken s 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 QueuedApnsService(ApnsService service)
public QueuedApnsService(ApnsService service, ThreadFactory tf)
public void push(ApnsNotification msg)
ApnsService
message
to the desired
destination.push
in interface ApnsService
public void start()
ApnsService
public void stop()
ApnsService
public Map<String,Date> getInactiveDevices() throws NetworkIOException
ApnsService
getInactiveDevices
in interface ApnsService
NetworkIOException
- if a network error occurred
while retrieving invalid device connectionpublic void testConnection() throws NetworkIOException
ApnsService
NetworkIOException
- if the Apple servers aren't reachable
or the service cannot send notifications for nowpublic EnhancedApnsNotification push(String deviceToken, String payload) throws NetworkIOException
ApnsService
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.push
in interface ApnsService
deviceToken
- 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 ApnsService
NetworkIOException
public EnhancedApnsNotification push(byte[] deviceToken, byte[] payload) throws NetworkIOException
ApnsService
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.push
in interface ApnsService
deviceToken
- 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 ApnsService
NetworkIOException
public Collection<EnhancedApnsNotification> push(Collection<String> deviceTokens, String payload) throws NetworkIOException
ApnsService
payload
to iPhone of deviceToken
s 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 ApnsService
deviceTokens
- 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 ApnsService
NetworkIOException
public Collection<EnhancedApnsNotification> push(Collection<byte[]> deviceTokens, byte[] payload) throws NetworkIOException
ApnsService
payload
to iPhone of deviceToken
s 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 ApnsService
deviceTokens
- 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 ApnsService
NetworkIOException
Copyright © 2015. All rights reserved.