FME Transformers: 2024.2
FME Transformers: 2024.2
GCMMessenger
Sends messages to Android devices using Google Cloud Messaging (GCM).
Usage Notes
The performance of this transformer is dependent on the amount of memory allocated to the Java Virtual Machine (JVM). The following environment variables allow you to specify memory available to Java Plugins:
- FME_JVM_MIN_HEAP_SIZE: Initial heap size for initializing the JVM. If unset, the default value is 1024K.
These variables must be set in multiples of 1024 and greater than 1 MB. To indicate kilobytes, megabytes, or gigabytes, append k or K, m or M, or g or G respectively. For example, any of these values is acceptable:
6291456
6144k
6m
- FME_JVM_MAX_HEAP_SIZE: Maximum heap size for initializing the JVM. If unset, the default value is 16384K.
These variables must be set in multiples of 1024 and greater than 2 MB. To indicate kilobytes, megabytes, or gigabytes, append k or K, m or M, or g or G respectively. For example, any of these values is acceptable:
83886080
81920k
80m
Note To pass additional parameters used by FME to the Java Virtual Machine, use the JAVA_TOOL_OPTIONS environment variable.
Input Ports
Input
This transformer accepts any feature.
Output Ports
Initiator
Input features are output through this port with an additional attribute (_gcm_response) that contains the raw response from GCM. If more than one call was made to GCM then this will be a JSON Array of all the responses.
Replace
Any registration IDs that GCM has new values for in its database will be output through here as part of the _old_id attribute. The new “Canonical ID” will be contained in the _new_id attribute. It is recommended that you replace the old ID with the new one as it will eventually get deleted from GCM storage.
Unregistered
Registration IDs of devices that no longer have the app (for which they were issued) installed will be output through here as part of the _unregistered_id attribute. These should be removed from your database.
Error
If any other error occurs, the error code and the corresponding registration ID will be output through this port.
Parameters
GCM Request
Message Content
The source of the message. To build a message from parameters, use From Parameters. To manually build a message from raw JSON, use From Custom JSON.
Send Message To
The final destination of the message. To deliver the message to Android devices, use GCM Server. To output the message to an attribute, use Output Attribute.
Output Attribute
When Send Message To is Output Attribute, the name of the output attribute that will contain the message.
API Key
When Send Message To is GCM Server, the API key. The GCM developer API key is used for authorizing the transformer to the Google Cloud Messaging service. The API key is associated with the Android application developer, and generating it is a one-time process. To do so, follow the instructions in Obtaining an API Key.
Message Content Parameters
The following section is available when Message Content is From Parameters.
Device IDs
The list of target Android devices to receive notifications. Each Android device can register itself to the Google Cloud Messaging service, and when doing so, acquires a registration ID that uniquely identifies the device.
The registration ID is different for each unique Android device/application pair, so it cannot be shared between different applications. When configuring the GCMMessenger to work with a new application, new registration IDs must be acquired.
To register an Android application to the Google Cloud Messaging service, send a com.google.android.c2dm.intent.REGISTER intent. The registration ID is returned to the application in an intent extended string field registration_id. This process is detailed in Writing Android Applications that Use GCM.
GCM Data
Additional data to send with the message.
Advanced Message Content Options
Collapse Key
An arbitrary string that is used to collapse multiple, similar messages when a device is offline, so that only the last message is sent. For example, if 100 messages with the same Collapse Key are sent to a device while it is turned off, the device will only receive the last message once it is turned on.
Delay While Idle
When set to True, messages will not be immediately delivered to Android devices when they are idle, but when they become active.
Time To Live (s)
The amount of time for a message to be stored on GCM servers before it is discarded. When left unspecified, the default time is 4 weeks.
Package Name
Application package name. This name restricts message delivery to applications on Android devices that match the package name.
Dry Run
When set to True, test without actually sending a message to target Android device.
Custom JSON Message Content
The following section is available when Message Content is From Custom JSON.
JSON Message
The JSON message to send.
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
FME Community
The FME Community has a wealth of FME knowledge with over 20,000 active members worldwide. Get help with FME, share knowledge, and connect with users globally.
Search for all results about the GCMMessenger on the FME Community.