【发布时间】:2014-05-12 14:30:14
【问题描述】:
钛版:3.1.3。
我仍在使用适用于 Android 的 MQTT,直到几周前一切正常(可能直到 mqtt on acs 被弃用)。但我读到仍然可以使用 MQTT(而不是 gcm)。根据 appcelerator 上的另一篇文章,我只需要在 tiapp.xml 中定义 mqtt,但这不起作用。
这是我的 tiapp.xml 的一部分
<property name="acs-push-type-development" type="string">mqtt</property>
<property name="acs-push-type-production" type="string">mqtt</property>
<property name="acs-push-type" type="string">mqtt</property>
...
<module platform="android" version="2.3.2">ti.cloudpush</module>
<module platform="android" version="2.1.2">ti.map</module>
<module platform="commonjs" version="2.3.7">ti.cloud</module>
这就是我从 appcelerator 日志中得到的信息:
`"response": {"push_log_details": [
{
"created_at": "2014-05-12T13:02:35.389Z",
"updated_at": "2014-05-12T13:02:31.094Z",
"type": "android",
"android_type": 1,
"app_id": "52724d7cd72ec85152039256",
"channel": "stickin",
"_id": "5370c66be511ea7ab99881d4",
"token": "ND1M2IX8RU8RGJDICW13I9V",
"push_id": "5370c6641316e90db2311567",
"send_status": 2,
"sent_at": "2014-05-12T13:02:30.996Z",
"error_message": "argument cannot be null",
"msg_id": "fa89cfb6-f2d2-4222-b442-a47d2625b419"
},
{
"created_at": "2014-05-12T13:02:35.389Z",
"updated_at": "2014-05-12T13:02:31.094Z",
"type": "android",
"android_type": 1,
"app_id": "52724d7cd72ec85152039256",
"channel": "stickin",
"_id": "5370c66be511ea7ab99881d6",
"token": "ND13ST3OA0MHE079H6EYV8P",
"push_id": "5370c6641316e90db2311567",
"send_status": 2,
"sent_at": "2014-05-12T13:02:30.996Z",
"error_message": "argument cannot be null",
"msg_id": "77fc5c7f-9703-46e5-a433-7be0796421f2"
}, .....
`
"argument cannot be null" 似乎是一个 gcm 响应代码。我尝试删除 gcm 的 apiKey 和发件人 id 并仅保存应用程序包名称 (MQTT),但随后我收到错误 gcm_apiKey 为空。如果我在 tiapp.xml 中定义 mqtt,我认为 push 不使用 gcm?顺便说一句,在 iOS 上一切正常,但当然 mqtt 并没有在那里使用。
【问题讨论】:
标签: android push appcelerator google-cloud-messaging mqtt