简体   繁体   English

仅在Android上发生Appcelerator推送通知错误

[英]Appcelerator Push Notification error on Android only

Titanium version: 3.1.3. 钛版:3.1.3。

I'm still using MQTT for Android and everything worked fine until a few weeks ago (maybe until mqtt on acs got deprecated). 我仍在使用适用于Android的MQTT,直到几周前一切正常(也许直到不推荐使用acs上的mqtt为止)。 But I read that it is possible to still use MQTT (instead of gcm). 但是我读到仍然可以使用MQTT(而不是gcm)。 According to another post on appcelerator I just had to define mqtt in the tiapp.xml, but this does not work. 根据关于appcelerator的另一篇文章,我只需要在tiapp.xml中定义mqtt,但这是行不通的。

This is part of my tiapp.xml 这是我的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>

That is what I get from the appcelerator logs: 那就是我从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" seems like a gcm response code. “参数不能为null”似乎是gcm响应代码。 I tried removing apiKey and sender id of gcm and to only save the Application Packagename (MQTT), but then I get the error gcm_apiKey is null. 我尝试删除gcm的apiKey和发件人ID,并且仅保存应用程序包名称(MQTT),但是随后出现错误gcm_apiKey为null。 I thought push is not using gcm if I define mqtt in the tiapp.xml? 我以为如果我在tiapp.xml中定义mqtt,则推送不使用gcm吗? By the way, on iOS everything is working fine, but of course mqtt is not used there. 顺便说一句,在iOS上一切正常,但是这里不使用mqtt。

Check the following 检查以下内容

  1. CloudPush module version you are using should be below 3.2.0 您使用的CloudPush模块版本应低于3.2.0

  2. You should specify 'android' as type while subscribing to the push notification. 订阅推送通知时,应将“ android”指定为类型。 (in the case of GCM, you have to use 'gcm') (对于GCM,您必须使用'gcm')

However Appcelerator has removed the MQTT support from March 15th 2014. . 但是, Appcelerator从2014年3月15日起取消了对MQTT的支持 So latest CloudPush modules will not support MQTT anymore. 因此,最新的CloudPush模块将不再支持MQTT。 See the below screenshot. 请参见下面的屏幕截图。 You may see this on the ACS server. 您可能会在ACS服务器上看到此消息。 You need to upgrade your app to GCM to fix the issues and upgrading to GCM is pretty simple. 您需要将应用程序升级到GCM以解决问题,并且升级到GCM非常简单。 I had already done it earlier. 我之前已经做过。 I suggest you should upgrade your app to GCM support. 建议您将应用升级到GCM支持。

屏幕截图

Also visit Android Push Notification: Deprecating MQTT in favor of GCM in Appcelerator Blog. 还请访问Appcelerator博客中的Android推送通知:不推荐使用MQTT,而推荐使用GCM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM