{ "id": "166526", "key": "AC-4848", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-03-16T14:11:01.000+0000", "created": "2017-03-09T17:31:55.000+0000", "labels": [ "android", "defect" ], "versions": [ { "id": "17038", "name": "Appcelerator Studio 4.5.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T14:11:01.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14560", "name": "Arrow Push" } ], "description": "ACS push notifications are breaking. It displays JSON payload in the notification body. Please check the attached screenshot. I am assuming the break is due to some special character like hyphen.", "attachment": [ { "id": "61810", "filename": "1.jpeg", "author": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T17:27:00.000+0000", "size": 128687, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "ACS push notifications break", "creator": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "410304", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I tested ACS push. It's working fine. Please share code that you are using. I am using a sample code from http://titaniumsolution.blogspot.com/2016/12/sending-push-via-firebase-api-key.html. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-03-09T18:11:18.000+0000", "updated": "2017-03-09T18:11:18.000+0000" }, { "id": "410313", "author": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The notification is sent from the php server. Its not the front end code that breaks the notifications, its something with the server side push. I am pasting the code below\r\n\r\n $username, 'password' => $password);\r\n\r\n /*** INIT CURL *******************************************/\r\n $curlObj = curl_init();\r\n $c_opt = \tarray(CURLOPT_URL => 'https://api.cloud.appcelerator.com/v1/users/login.json?key='.$key,\r\n CURLOPT_COOKIEJAR => $tmp_fname, \r\n CURLOPT_COOKIEFILE => $tmp_fname, \r\n CURLOPT_RETURNTRANSFER => true, \r\n CURLOPT_POST => 1,\r\n CURLOPT_POSTFIELDS => \"login=\" . $username . \"&password=\" . $password,\r\n CURLOPT_FOLLOWLOCATION => 1,\r\n CURLOPT_TIMEOUT => 60);\r\n\r\n /*** LOGIN **********************************************/\r\n\r\n curl_setopt_array($curlObj, $c_opt); \r\n $session = curl_exec($curlObj); \r\n\r\n /*** SEND PUSH ******************************************/\r\n \r\n $c_opt[CURLOPT_URL] = 'https://api.cloud.appcelerator.com/v1/push_notification/notify_tokens.json?key='.$key; \r\n $c_opt[CURLOPT_POSTFIELDS] = \"channel=\".$channel.\"&payload=\".$json.\"&to_tokens=\".$to_tokens; \r\n curl_setopt_array($curlObj, $c_opt); \r\n $session = curl_exec($curlObj);\r\n\r\n /*** THE END ********************************************/\r\n curl_close($curlObj);\r\n header('Content-Type: application/json');\r\n die(json_encode(array('response' => json_decode($session)))); \r\n?>\r\n", "updateAuthor": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T18:27:57.000+0000", "updated": "2017-03-09T18:28:38.000+0000" }, { "id": "411193", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "So, you are not using our ArrowDB server for push? We checked and the push is fine from ArrowDB. The problem is with your php script. Can you try with the code here https://gist.github.com/ricardoalcocer/51b63b6ddba293c83c3e ? Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-03-10T14:36:31.000+0000", "updated": "2017-03-10T14:37:15.000+0000" }, { "id": "411197", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Check [this link|https://www.fusetools.com/community/forums/general/push_notifications_body_json_structure] that states that Android notification responses are usually under the \"notification\" object I guess.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-10T15:19:41.000+0000", "updated": "2017-03-10T15:19:41.000+0000" }, { "id": "411207", "author": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Sharif The gist link you pasted has identical code as mine accept for one thing. My code has header('Content-Type: application/json'); which is not present in the link.\r\n", "updateAuthor": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-10T16:52:32.000+0000", "updated": "2017-03-10T16:52:32.000+0000" }, { "id": "412070", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~zarirbhesania@gmail.com], Can you get back on Hans comment? Thanks. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-03-14T14:43:16.000+0000", "updated": "2017-03-14T14:43:16.000+0000" }, { "id": "412774", "author": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Sharif AbuDarda,\r\n\r\nI figured out the issue. The push payload was breaking because of \"&\" used in the title/message. With URL encode this issue is resolved. For both iOS and android common payload structure is used.", "updateAuthor": { "name": "zarirbhesania@gmail.com", "key": "zarirbhesania@gmail.com", "displayName": "Zarir Bhesania", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T05:19:33.000+0000", "updated": "2017-03-16T05:19:33.000+0000" }, { "id": "412789", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Thanks for letting us know. Closing the issue. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-03-16T14:10:39.000+0000", "updated": "2017-03-16T14:10:39.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }