To Create a Google Cloud Messaging Subscription
Google Cloud Messaging Field | Description |
---|---|
API Key | The developer API key, used for authorizing the subscription to the Google Cloud Messaging service. |
Registration IDs | The list of target Android devices to receive notifications. Use a comma to separate multiple devices. |
Content Template | The notification content template. |
Overriding Behavior Using Notification Keywords
By default, a Google Cloud Messaging configuration allows for delivery of notifications to a fixed set of Android devices, with its message formatted by the prescribed content template. The Google Cloud Messaging subscriber also allows you to specificy target Android devices and message format in the incoming notification. The notification keywords that enable this overriding behavior are gcm_token
and subscriber_content
.
gcm_token
—Overrides the ‘Registration IDs’ field in a Google Cloud Messaging subscription. Use a comma to separate multiple devices.subscriber_content
—Overrides the ‘Content Template’ field in a Google Cloud Messaging subscription.Examples
The following Google Cloud Messaging Subscriber examples are based on this default configuration:
Registration IDs | 123456,abcdef |
Content Template | Message: {msg} |
Notification | Target Device(s) | Message Sent to Device(s) |
---|---|---|
{ "msg" : "Hello, world" } |
123456 abcdef |
Message: Hello, world |
{ "gcm_token" : "987654,fefefe", "msg" : "Hello, device" } |
987654 fefefe |
Message: Hello, device |
{ "subscriber_content" : "Alert", "msg" : "Ignored" } |
123456 abcdef |
Alert |
Demonstration App
FME Alerts is a demonstration app that showcases the capabilities of FME Server using an Apple Push subscriber. The app is available for free on the Apple App Store.