[英]Appcelerator Push Notification error on Android only
钛版:3.1.3。
我仍在使用适用于Android的MQTT,直到几周前一切正常(也许直到不推荐使用acs上的mqtt为止)。 但是我读到仍然可以使用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"
}, .....
`
“参数不能为null”似乎是gcm响应代码。 我尝试删除gcm的apiKey和发件人ID,并且仅保存应用程序包名称(MQTT),但是随后出现错误gcm_apiKey为null。 我以为如果我在tiapp.xml中定义mqtt,则推送不使用gcm吗? 顺便说一句,在iOS上一切正常,但是这里不使用mqtt。
检查以下内容
您使用的CloudPush模块版本应低于3.2.0
订阅推送通知时,应将“ android”指定为类型。 (对于GCM,您必须使用'gcm')
但是, Appcelerator从2014年3月15日起取消了对MQTT的支持 。 因此,最新的CloudPush模块将不再支持MQTT。 请参见下面的屏幕截图。 您可能会在ACS服务器上看到此消息。 您需要将应用程序升级到GCM以解决问题,并且升级到GCM非常简单。 我之前已经做过。 建议您将应用升级到GCM支持。
还请访问Appcelerator博客中的Android推送通知:不推荐使用MQTT,而推荐使用GCM 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.