Gcmmessenger.
使用Google Cloud Messaging(GCM)向Android设备发送消息。
Usage Notes
此转换器的性能取决于分配给Java虚拟机(JVM)的内存量。以下环境变量允许您指定Java插件可用的内存:
- fme_jvm_min_heap_size:初始化JVM的初始堆大小。默认值为1024k。
- FME\u JVM\u MAX\u HEAP\u SIZE:初始化JVM的最大堆大小。默认值为16384K。
如果未命中,JVM会应用默认值。如果设置,则值必须是1024k的倍数(例如,4m和64m,或4096k和32768k)。
注:要将FME使用的其他参数传递给Java虚拟机,请使用Java\u TOOL\u OPTIONS环境变量。
Input Ports
This transformer accepts any feature.
输出端口
Input features are output through this port with an additional attribute (_gcm_response.)包含GCM的原始响应。如果对GCM进行了多个调用,那么这将是一个包含所有响应的JSON数组。
GCM在其数据库中有新值的任何注册ID都将通过此处作为_old_id属性。新的“规范ID”将包含在_new_id属性。建议您更换old ID with the new one as it will eventually get deleted from GCM storage.
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_未注册的\u id属性。这些应该从数据库中删除。
如果发生任何其他错误,则会通过此端口输出错误代码和相应的注册ID。
参数
GCM Request
消息的源。要从参数生成消息,请使用从参数。从原始json手动构建消息,使用来自自定义JSON。
消息的最终目的地。要将消息传递到Android设备,请使用GCM服务器。To output the message to an attribute, use输出属性。
When发送消息到是输出属性, the name of the output attribute that will contain the message.
When发送消息到是GCM服务器, 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获取API密钥。
消息内容参数
以下部分适用于消息内容是从参数。
接收通知的目标Android设备列表。每个Android设备都可以将自身注册到Google Cloud Messaging Service,并且在此操作时,获取唯一标识设备的注册ID。
每个唯一的Android设备/应用程序对的注册ID是不同的,因此不能在不同的应用程序之间共享。配置GCMMessenger以使用新应用程序时,必须获取新的注册ID。
要向Google云消息服务注册Android应用程序,请发送com.google.android.c2dm.intent.register.intent. The registration ID is returned to the application in an intent extended string fieldregistrign_id.。这个过程详述了编写使用GCM的Android应用程序。
与消息一起发送的其他数据。
高级消息内容选项
任意字符串用于折叠多个类似消息的设备脱机,以便仅发送上一条消息。例如,如果100条消息相同折叠键are sent to a device while it is turned off, the device will only receive the last message once it is turned on.
当设置为真的, messages will not be immediately delivered to Android devices when they are idle, but when they become active.
在丢弃它之前要存储在GCM服务器上的消息的时间量。左侧未指定时,默认时间为4周。
应用程序包名称。此名称将消息传递限制为符合包名称的Android设备上的应用程序。
当设置为真的, test without actually sending a message to target Android device.
自定义JSON消息内容
以下部分适用于消息内容是来自自定义JSON。
The JSON message to send.
编辑变压器参数
使用一组菜单选项,可以通过引用工作空间中的其他元素来指定转换器参数。更高级的功能,如高级编辑器和算术编辑器,也可以在一些变压器。要访问这些选项的菜单,请单击在适用参数旁边。有关详细信息,请参阅Transformer Parameter Menu Options。
变压器类别
Search FME Knowledge Center
Search for samples and information about this transformer on theFME知识中心。