|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PushService
Provides access to the StackMob push notification service, allowing the creation of push notifications directly from a custom code method.
| Method Summary | |
|---|---|
void |
broadcastPush(int badge,
String sound,
String alert)
Broadcast a push notification to all devices running this app. |
Map<String,Long> |
getExpiredTokens(boolean clear)
Get the tokens, which have been reported as expired by Apple's feedback service |
Map<String,String> |
getTokensForUsers(List<String> users)
Finds the device push tokens for the given user list. |
void |
registerToken(String username,
String token)
Assign a push token to the specified user. |
void |
removeToken(String token)
Removes the token from the list of registered tokens. |
void |
sendPush(List<String> tokens,
int badge,
String sound,
String alert)
Send a push notification to all devices identified by the tokens provided. |
void |
sendPush(List<String> recipients,
int badge,
String sound,
String alert,
boolean recipientsAreTokens)
Send a push notification to all devices identified by the recipients list. |
| Method Detail |
|---|
void sendPush(List<String> tokens,
int badge,
String sound,
String alert)
throws PushServiceException
sendPush(tokens, badge, sound, alert, true)
tokens - the device tokens to which the push notification should be sentbadge - the badge for the push notification; specifies the number to be displayed with the app iconsound - the sound to be played by the devicesalert - the text of the alert to be displayed by the devices
PushServiceException - if an error occurs
void sendPush(List<String> recipients,
int badge,
String sound,
String alert,
boolean recipientsAreTokens)
throws PushServiceException
recipientsAreTokens parameter. If true, the recipients list
is considered to consist of device tokens. If false, the recipients list will be considered to be user IDs. In
either case, tokens need to be registered via the registerToken(String, String) call, before they can be
used.
recipients - the device tokens to which the push notification should be sentbadge - the badge for the push notification; specifies the number to be displayed with the app iconsound - the sound to be played by the devicesalert - the text of the alert to be displayed by the devicesrecipientsAreTokens - the type of entries in the recipients list. True if specifying tokens; false for users.
PushServiceException - if an error occurs
void broadcastPush(int badge,
String sound,
String alert)
throws PushServiceException
badge - the badge for the push notification; specifies the number to be displayed with the app iconsound - the sound to be played by the devicesalert - the text of the alert to be displayed by the devices
PushServiceException - if an error occurs
Map<String,Long> getExpiredTokens(boolean clear)
throws DatastoreException
clear - if true, the set of expired tokens will be cleared after the call. if false, the current token set
will be retained on the server
Map, where the token is the key, and
the value is the expiration time, represented as milliseconds since January 1, 1970 UTC
DatastoreException - if an error occurs
void registerToken(String username,
String token)
throws DatastoreException
username - a username to associate with the specified tokentoken - iOS device token
DatastoreException - if an error occurs
Map<String,String> getTokensForUsers(List<String> users)
throws DatastoreException
getExpiredTokens(boolean) to get the expired tokens.
users - list of user IDs
DatastoreException - if an error occurs
void removeToken(String token)
throws DatastoreException
token - token to be removed
DatastoreException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||