{ "id": "166820", "key": "TIMOB-25022", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2017-03-28T02:35:28.000+0000", "priority": null, "labels": [ "android", "engSchedule", "pushnotification" ], "versions": [ { "id": "19275", "description": "Patch release for 6.0.x regressions or important fixes", "name": "Release 6.0.3", "archived": false, "released": true, "releaseDate": "2017-03-22" } ], "issuelinks": [ { "id": "55723", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "169219", "key": "AC-5121", "fields": { "summary": "Ti.CloudPush push notification callback does not work after close window", "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": null, "updated": "2019-10-17T07:10:03.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "The CloudPush Callback is not working after the app open a new window.\r\n\r\nTi.Cloud Modules Version : 3.2.11\r\nTi.Cloudpush Modules Version: 4.0.3\r\nTi.SDK Version : 6.0.3 GA\r\n\r\nThe CloudPush Callback only fired when i first launched the app and didn't open a new window whenever a new notifications come in.\r\n\r\nThat means it will not fire anymore if i open a second window and a new notification come in.\r\nBut, the callback will show the previous notification which didn't show in the second window after i kill the app and relaunch it.\r\n\r\nBesides that, the CloudPush trayClickLaunchedApp and trayClickFocusedApp EventListener not working also.\r\n\r\nThere are some Warning showed in the console when i stayed in second window and receive a new notification come in as the screenshort attached.\r\n\r\nSample code of my project:\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------\r\nalloy.js\r\n\r\nvar CloudPush = require('ti.cloudpush');\r\nCloudPush.debug = true;\r\nCloudPush.enabled = true;\r\nCloudPush.showTrayNotificationsWhenFocused = true;\r\nCloudPush.showTrayNotification = true;\r\nCloudPush.focusAppOnPush = false;\r\nvar deviceToken = null;\r\nvar Cloud = require('ti.cloud');\r\nCloud.debug = true;\r\n\r\nCloudPush.retrieveDeviceToken({\r\n\tsuccess: deviceTokenSuccess,\r\n\terror: deviceTokenError\r\n});\r\n\r\nfunction deviceTokenSuccess(e) {\r\n\tdeviceToken = e.deviceToken;\r\n\tloginDefault();\r\n}\r\n\r\nfunction deviceTokenError(e) {\r\n\tconsole.log('Failed to register for push notifications! ' + e.error);\r\n\talert('Failed to register for push notifications! ' + e.error);\r\n}\r\n\r\n\tfunction loginDefault(e) {\r\n\t\tCloud.Users.login({\r\n\t\t\tlogin: 'test@gmail.com',\r\n\t\t\tpassword: 'TESTabc123'\r\n\t\t}, function (e) {\r\n\t\t\tif (e.success) {\r\n\t\t\t\tdefaultSubscribe();\r\n\t\t\t//\talert(\"Successfully Loged In\");\r\n\t\t\t} else {\r\n\t\t\t//\talert('Error login-----: ' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\nfunction defaultSubscribe() {\r\n\tCloud.PushNotifications.subscribe({\r\n\t\tchannel: 'test1',\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('Device Subscribed!');\r\n\t\t} else {\r\n\t\t\talert('Error defaultSubscribe : ' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t\t}\r\n\t});\r\n}\r\n\r\n\r\nCloudPush.addEventListener('callback', function (evt) {\r\n\talert(\"Notification received: \" + evt.payload);\r\n});\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});\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});\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------\r\n\r\nindex.js\r\n\r\n$.index.open();\r\n\r\nfunction NEWWIN(e){\r\n\tAlloy.createController(\"Newwin\").getView().open();\r\n\t$.index.close();\t\r\n}\r\n\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------\r\nindex.xml\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\t\r\n\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------\r\nNewwin.js\r\n\r\nvar args = $.args;\r\n\r\nfunction BACKUPINDEX(e){\r\n Alloy.createController(\"index\").getView().open();\r\n $.container.close();\r\n\r\n}\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------\r\n\r\nNewwin.xml\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\r\n\r\n-----------------------------------------------------------------------------------------------------------------------------", "attachment": [ { "id": "61919", "filename": "Screenshot_20170328-100456.png", "author": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T02:34:59.000+0000", "size": 34125, "mimeType": "image/png" }, { "id": "61923", "filename": "Screenshot_20170328-101559.png", "author": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T02:34:50.000+0000", "size": 23349, "mimeType": "image/png" }, { "id": "61920", "filename": "Screenshot_20170328-101602.png", "author": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T02:34:52.000+0000", "size": 18606, "mimeType": "image/png" }, { "id": "61921", "filename": "Screenshot_20170328-101605.png", "author": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T02:35:02.000+0000", "size": 18923, "mimeType": "image/png" }, { "id": "61922", "filename": "Screenshot 2017-03-28 10.21.37.png", "author": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T02:35:06.000+0000", "size": 353589, "mimeType": "image/png" } ], "flagged": false, "summary": "Android : CloudPush Callback didnt fire after open a new window in Alloy", "creator": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Yellowcube", "key": "yellowcube", "displayName": "Yellowcube", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.12.3\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 16.0GB\r\n\r\nNode.js\r\n Node.js Version = 4.6.2\r\n npm Version = 2.15.11\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.8\r\n Core Package = 6.1.0\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.11\r\n node-appc Version = 0.2.39", "comment": { "comments": [ { "id": "416159", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please attach an app folder in here. With your sample code I end up with the \r\n[INFO] [app.js] Titanium entry point processing...\r\n[ERROR] \r\n[ERROR] Alloy compiler failed\r\n\r\nThanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-03-29T16:14:49.000+0000", "updated": "2017-03-29T16:14:49.000+0000" }, { "id": "424801", "author": { "name": "blackedbyte@gmail.com", "key": "blackedbyte@gmail.com", "displayName": "Gabriel Gallardo", "active": true, "timeZone": "America/Santiago" }, "body": "The problem occurs at the time of closing the window from which it subscribes to push notifications, Titanium should persist CloudPush even when you close the window from which it was instantiated, please provide a solution for that problem...", "updateAuthor": { "name": "blackedbyte@gmail.com", "key": "blackedbyte@gmail.com", "displayName": "Gabriel Gallardo", "active": true, "timeZone": "America/Santiago" }, "created": "2017-07-26T16:27:59.000+0000", "updated": "2017-07-26T16:27:59.000+0000" }, { "id": "450647", "author": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any progress for this issue? It's being long so we can update to customer.\r\nThank you.", "updateAuthor": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T20:16:23.000+0000", "updated": "2019-08-20T20:16:23.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }