{ "id": "134741", "key": "AC-1530", "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": "2014-10-28T08:02:56.000+0000", "created": "2014-08-14T12:35:01.000+0000", "labels": [ "TCSupport" ], "versions": [], "issuelinks": [ { "id": "39900", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "133852", "key": "CS-14", "fields": { "summary": "ACS Registered Push Notification Device Count", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:37:59.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": [], "description": "h4. Problem Description\r\nThe console tab in ACS shows a number for ios and android devices that are \"Registered for Push Notifications\" We have over 800 devices listed under the \"Show Registered Devices\" tab however it says there are 0 iOS devices and 0 Android devices. \r\n\r\nWe Tried With the Following Code and We found some issues in web-portal Push Notification Subscribed Devices. Sometimes it Sows the Devices, Other times only the Device got Detected but not listed in “Show Subscribed Devices” Section.\r\n\r\nh4. TestCase\r\n\r\n{code}\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#ccc',\r\n\ttitle : 'Android Cloud Push Notification'\r\n});\r\n \r\nvar CloudPush = require('ti.cloudpush');\r\nCloudPush.debug = true;\r\nCloudPush.enabled = true;\r\nCloudPush.showTrayNotificationsWhenFocused = true;\r\nCloudPush.focusAppOnPush = false;\r\n \r\nvar deviceToken;\r\nvar Cloud = require('ti.cloud');\r\nCloud.debug = true;\r\n \r\nvar submit = Ti.UI.createButton({\r\n\ttitle : 'Register For Push Notification',\r\n\tcolor : '#000',\r\n\theight : 53,\r\n\twidth : 200,\r\n\ttop : 100,\r\n});\r\n \r\nwin.add(submit);\r\n \r\nsubmit.addEventListener('click', function(e) {\r\n\tCloudPush.retrieveDeviceToken({\r\n\t\tsuccess : function deviceTokenSuccess(e) {\r\n\t\t\talert('Device Token: ' + e.deviceToken);\r\n\t\t\tdeviceToken = e.deviceToken;\r\n\t\t\tloginDefault();\r\n\t\t},\r\n\t\terror : function deviceTokenError(e) {\r\n\t\t\talert('Failed to register for push! ' + e.error);\r\n\t\t}\r\n\t});\r\n});\r\n \r\nfunction loginDefault(e) {\r\n\t// At first you need to create an user from the application dashboard \r\n\t// Then login that email and password\r\n\tCloud.Users.login({\r\n\t\tlogin : 'user’,\r\n\t\tpassword : 'pass'\r\n\t}, function(e) {\r\n\t\tif (e.success) {\r\n\t\t\talert(\"login success\");\r\n\t\t\tdefaultSubscribe();\r\n\t\t} else {\r\n\t\t\talert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t\t}\r\n\t});\r\n}\r\n \r\nfunction defaultSubscribe() {\r\n\tCloud.PushNotifications.subscribe({\r\n\t\tchannel : 'alert',\r\n\t\tdevice_token : deviceToken,\r\n\t\ttype : 'android'\r\n\t}, function(e) {\r\n\t\tif (e.success) {\r\n\t\t\talert('Subscribed for Push Notification!');\r\n\t\t} else {\r\n\t\t\talert('Error:' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t\t}\r\n\t});\r\n}\r\n \r\nCloudPush.addEventListener('callback', function(evt) {\r\n\t//alert(evt);\r\n\t//alert(evt.payload);\r\n});\r\n \r\nCloudPush.addEventListener('trayClickLaunchedApp', function(evt) {\r\n\tTi.API.info('Tray Click Launched App (app was not running)');\r\n\t//alert('Tray Click Launched App (app was not running');\r\n});\r\n \r\nCloudPush.addEventListener('trayClickFocusedApp', function(evt) {\r\n\tTi.API.info('Tray Click Focused App (app was already running)');\r\n\t//alert('Tray Click Focused App (app was already running)');\r\n});\r\n \r\nwin.open();\r\n\r\n{code}\r\n\r\nh4. Steps to reproduce\r\n\r\n1. Create a new app with Cloud Service Enabled\r\n2. Copy the Code provided to the new app\r\n3. [Login|https://my.appcelerator.com/apps/] ,you will see your new app is listed there.\r\n4. Go to the [link|https://console.developers.google.com] and create a Google API project and enable its GSM service. Follow the [link|http://docs.appcelerator.com/platform/latest/#!/guide/Configuring_push_services] for Details.\r\n5. Get the \"Google Cloud Messaging (GCM)\" API Key and \"Google Cloud Messaging (GCM) Sender ID\" and submit them in In the web-portal \"Android Push Configuration section\", of your app.\r\n6. Create an user in your app with your login details in the web-portal.\r\n7. Provide the login details in the \"Code segment\", “Cloud.Users.login” section.\r\n8. Run the project in an android device.\r\n9. Touch “Push Notification”, you will see the device is detected\r\n\r\nh4. Expected results\r\n\r\nIn web-portal, under the “Push Notification”, “Show Subscribed Devices” section the device should appear.\r\n\r\nh4. Actual Results\r\n\r\nSometimes the Device is detected by the app but it’s not listed in the web-portal under the “Push Notification”, “Show Subscribed Devices” section.\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "ACS Registered Push Notification Device Count", "creator": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "subtasks": [], "reporter": { "name": "david.call@uvu.edu", "key": "david.call@uvu.edu", "displayName": "David Call", "active": true, "timeZone": "America/Denver" }, "environment": "OSX Chrome\r\nCLI version 3.3.0, \r\nTitanium SDK version 3.3.0.GA, 3.3.0.RC\r\nti.cloud Version 3.2.3\r\nti.cloudpush Version 3.3.0", "comment": { "comments": [ { "id": "318640", "author": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "body": "[~david.call@uvu.edu], I have cloned original ticket here.\r\n\r\n[~mpmiranda], Please update this ticket when get updates on internal one.", "updateAuthor": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "created": "2014-08-14T12:38:20.000+0000", "updated": "2014-08-14T12:38:20.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }