java.lang.Object | |
↳ | com.google.android.gcm.server.Message |
GCM message.
Instances of this class are immutable and should be created using a
Message.Builder
. Examples:
Simplest message:
Message message = new Message.Builder().build();
Message with optional attributes:
Message message = new Message.Builder()
.collapseKey(collapseKey)
.timeToLive(3)
.delayWhileIdle(true)
.dryRun(true)
.restrictedPackageName(restrictedPackageName)
.build();
Message with optional attributes and payload data:
Message message = new Message.Builder()
.collapseKey(collapseKey)
.timeToLive(3)
.delayWhileIdle(true)
.dryRun(true)
.restrictedPackageName(restrictedPackageName)
.addData("key1", "value1")
.addData("key2", "value2")
.build();
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Message.Builder |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the collapse key.
| |||||||||||
Gets the payload data, which is immutable.
| |||||||||||
Gets the restricted package name.
| |||||||||||
Gets the time to live (in seconds).
| |||||||||||
Gets the delayWhileIdle flag.
| |||||||||||
Gets the dryRun flag.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the collapse key.
Gets the payload data, which is immutable.
Gets the restricted package name.
Gets the time to live (in seconds).
Gets the delayWhileIdle flag.
Gets the dryRun flag.