public class UnifiedPushMessage extends Object
For details have a look at the Message Format Specification.
| Constructor and Description |
|---|
UnifiedPushMessage(Map<String,Object> data)
Messages are submitted as flexible JSON maps, like:
|
| Modifier and Type | Method and Description |
|---|---|
String |
getActionCategory()
Returns the value of the 'action-category', which is used on the client (iOS for now),
to invoke a certain "user action" on the device, based on the push message.
|
String |
getAlert()
Returns the value of the 'alert' key from the submitted payload.
|
int |
getBadge()
Returns the value of the 'badge' key from the submitted payload.
|
String |
getClientIdentifier()
The Client Identifier showing who triggered the Push Notification
|
Map<String,Object> |
getData()
Returns a Map, representing any other key-value pairs that were send
to the RESTful Sender API.
|
String |
getIpAddress()
The IP address from the agent that did issue the push message request.
|
SendCriteria |
getSendCriteria()
Returns the object that contains all the submitted query criteria.
|
String |
getSimplePush()
Returns the SimplePush specific version number.
|
String |
getSound()
Returns the value of the 'sound' key from the submitted payload.
|
int |
getTimeToLive()
Returns the value of the 'ttl' key from the submitted payload.
|
boolean |
isContentAvailable()
Used for in iOS specific feature, to indicate if content (for Newsstand or silent messages) has marked as
being available
Not supported on other platforms.
|
void |
setClientIdentifier(String clientIdentifier) |
void |
setIpAddress(String ipAddress) |
String |
toJsonString() |
String |
toString() |
public UnifiedPushMessage(Map<String,Object> data)
{
"alias" : ["someUsername"],
"deviceType" : ["someDevice"],
"categories" : ["someCategories"],
"variants" : ["someVariantIDs"],
"ttl" : 3600,
"message":
{
"key":"value",
"key2":"other value",
"alert":"HELLO!",
"action-category":"some value",
"sound":"default",
"badge":2,
"content-available" : true
},
"simple-push":"version=123"
}
This class give some convenient methods to access the query components (alias or deviceType),
the simple-push value or some highlighted keywords.public SendCriteria getSendCriteria()
public String getSimplePush()
public String getAlert()
public String getActionCategory()
public int getTimeToLive()
public String getSound()
public int getBadge()
public boolean isContentAvailable()
public Map<String,Object> getData()
"sport-news-channel15" : "San Francisco 49er won last game"
public String getIpAddress()
public void setIpAddress(String ipAddress)
public String getClientIdentifier()
public void setClientIdentifier(String clientIdentifier)
public String toJsonString()
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.