{ "id": "162286", "key": "TIMOB-23720", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-12-22T15:41:06.000+0000", "created": "2016-07-30T14:16:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "ipass1" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:37:06.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Hello,\r\n\r\nI’m having a problem with push notifications in the Android version of the App we are developing.\r\nSpecifically, it seems like push notifications work differently if my app has been sent to background using the “back” or “home” button of the phone.\r\n\r\n*1) FIRST CASE – background using back button*\r\nWhen I receive a push notification, I click on it, the App opens and display the right page\r\n\r\n*2) SECOND CASE - background using home button*\r\nThis time, when I receive a push notification and click on it, the App opens on the last page I was previously viewing, before I sent the app to background.\r\nThis is obviously not the right behavior.\r\n\r\nIt seems like the CallBack function for push notification is not called in this case; we are using Single Call Back.\r\n\r\nNow, the interesting thing is that if I open the App again immediately, now the callback works and the first thing I see in the App is the content of the push notification.\r\n\r\n\r\n\r\n---\r\nWe are using SingleCallback.\r\nThis bug is on Android only; on iOS devices everything is ok.\r\n\r\nOur code:\r\n\r\nif (isAndroid) {\r\nvar CloudPush = require('ti.cloudpush');\r\nCloudPush.setSingleCallback(true);\r\nCloudPush.retrieveDeviceToken({\r\nsuccess: deviceTokenSuccess,\r\nerror: deviceTokenError\r\n});\r\nCloudPush.addEventListener('callback', pushCallbackAll);\r\n}\r\n\r\n\r\n\r\n---\r\nI've also made a short video to let you see what happens:\r\nhttps://youtu.be/hiYwcY3vahY\r\n\r\n\r\nWhy does it happen? Any idea?\r\nThank you very much for your help,\r\nKind regards\r\nDavide", "attachment": [], "flagged": false, "summary": "Android - CallBack for push notifications doesn't work when app is open in background", "creator": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "environment": "Appcelerator Studio 4.6.0\r\nTitanium GA 5.3.1\r\nAndroid (any version)", "closedSprints": [ { "id": 784, "state": "closed", "name": "2016 Sprint 26 SDK", "startDate": "2016-12-17T01:24:57.928Z", "endDate": "2016-12-31T01:24:00.000Z", "completeDate": "2017-01-03T02:15:01.548Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "393844", "author": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "body": "Any update about this issue?\r\nThank you for your help,\r\nRegards", "updateAuthor": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "created": "2016-08-22T21:20:46.000+0000", "updated": "2016-08-22T21:20:46.000+0000" }, { "id": "395533", "author": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "body": "Sorry to bother you, but more than a month has passed without any answer.\r\nHave you been able to reproduce it?\r\nIs there any update?\r\nIf you need more information, please, just ask me.\r\n\r\nKind regards\r\nDavide", "updateAuthor": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "created": "2016-09-07T20:33:44.000+0000", "updated": "2016-09-07T20:33:44.000+0000" }, { "id": "400590", "author": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "body": "Hello,\r\nHas this bug been resolved with the latest releases of Studio 4.8.0 and Titanium 6.0.0?\r\nPlease, any feedback about it would be highly appreciated.\r\nYou haven't given a single reply so far...\r\nBest\r\nDavide", "updateAuthor": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "created": "2016-11-08T15:48:33.000+0000", "updated": "2016-11-08T15:48:33.000+0000" }, { "id": "400684", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~Peach1200], I am not able to reproduce the issue with a simple callback like an alert & setSingleCallback true .\r\nCan you provide me with a sample with which I can reproduce the issue?", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-10T00:47:53.000+0000", "updated": "2016-11-10T00:48:20.000+0000" }, { "id": "400750", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~Peach1200] I'm curious as to what you are doing inside your {{pushCallbackAll()}} method?\r\n\r\nHow are you creating the Intent to open the specific page you want?", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-11T01:24:25.000+0000", "updated": "2016-11-11T01:24:25.000+0000" }, { "id": "403809", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The intent to open the app should use the {{Ti.Android.FLAG_ACTIVITY_NEW_TASK}} intent.\r\n\r\nClosing as invalid.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-22T15:40:51.000+0000", "updated": "2016-12-22T15:40:51.000+0000" }, { "id": "407454", "author": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "body": "Hello @Gary Mathews\r\nSorry for my late reply.\r\n\r\nI've heard from my developer today about this issue.\r\nHe told me that we use the following module: {{Modules.CloudPush}}\r\n\r\nIf I'm not mistaken, we don't have direct access to the intent inside the module.\r\nAm I mistaken? How can we eventually check and change the intent used in that module?\r\n\r\n\r\n(sorry for my poor \"technical language\"; my developer does not speak english and I'm trying to translate what he says to me)\r\n\r\nThank you for your help,\r\nBest regards\r\nDavide", "updateAuthor": { "name": "Peach1200", "key": "peach1200", "displayName": "Davide Pecis", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-02-20T23:45:03.000+0000", "updated": "2017-02-20T23:46:00.000+0000" }, { "id": "439947", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:37:06.000+0000", "updated": "2018-08-06T17:37:06.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }