Class PushMessage
java.lang.Object
com.codename1.push.PushMessage
Immutable typed push message used by clients and sending code.
Common fields are provider-independent. Provider-specific options belong
under PushMessage.Builder.platform(String, Map). Received JSON must contain a
supported schema number and is exposed as immutable maps and lists.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PushMessage.Builderbuilder()Creates a message builder initialized with the current schema.getBody()getData()getId()getTitle()static PushMessageParses a schema-3 JSON envelope.toJson()toMap()
-
Field Details
-
SCHEMA_VERSION
public static final int SCHEMA_VERSIONCurrent JSON envelope schema.- See Also:
-
-
Method Details
-
builder
Creates a message builder initialized with the current schema.- Returns:
- a new builder
-
parse
Parses a schema-3 JSON envelope.- Parameters:
json- complete JSON object- Returns:
- an immutable message
- Throws:
IOException- if JSON is empty, invalid, or has an unsupported schema
-
getId
- Returns:
- the message identifier, or
null
-
getTitle
- Returns:
- the visible notification title, or
null
-
getBody
- Returns:
- the visible notification body, or
null
-
getImageUrl
- Returns:
- the rich-notification image URL, or
null
-
getDeepLink
- Returns:
- the application deep link, or
null
-
getCollapseKey
- Returns:
- the provider collapse key, or
null
-
getData
-
getSurface
-
getPlatformOptions
-
toMap
-
toJson
- Returns:
- this message encoded as JSON
-