Question

Titanium version: 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). But I read that it is possible to still use MQTT (instead of gcm). According to another post on appcelerator I just had to define mqtt in the tiapp.xml, but this does not work.

This is part of my 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:

`"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. 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. I thought push is not using gcm if I define mqtt in the tiapp.xml? By the way, on iOS everything is working fine, but of course mqtt is not used there.

Was it helpful?

Solution

Check the following

  1. CloudPush module version you are using should be below 3.2.0

  2. You should specify 'android' as type while subscribing to the push notification. (in the case of GCM, you have to use 'gcm')

However Appcelerator has removed the MQTT support from March 15th 2014.. So latest CloudPush modules will not support MQTT anymore. See the below screenshot. You may see this on the ACS server. You need to upgrade your app to GCM to fix the issues and upgrading to GCM is pretty simple. I had already done it earlier. I suggest you should upgrade your app to GCM support.

Screenshot

Also visit Android Push Notification: Deprecating MQTT in favor of GCM in Appcelerator Blog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top