{ "id": "172981", "key": "AC-6134", "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": "6", "description": "", "name": "Hold" }, "resolutiondate": "2019-02-20T17:05:50.000+0000", "created": "2019-02-09T09:24:13.000+0000", "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-02-20T17:05:51.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When the app is not running and the user receives a notification, the Listener trayClickLaunchedApp is not fired.\r\n\r\n{code:java}\r\nWARN] : W/System.err: java.io.FileNotFoundException: Resources/sound/default\r\n[WARN] : W/System.err: \tat android.content.res.AssetManager.openAssetFd(Native Method)\r\n[WARN] : W/System.err: \tat android.content.res.AssetManager.openFd(AssetManager.java:394)\r\n[WARN] : W/System.err: \tat com.appcelerator.aps.APSCloudPush.getAndTransferFile(APSCloudPush.java:617)\r\n[WARN] : W/System.err: \tat com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:489)\r\n[WARN] : W/System.err: \tat com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:306)\r\n[WARN] : W/System.err: \tat com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.handleReceiver(ActivityThread.java:3291)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.-wrap17(Unknown Source:0)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1706)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:105)\r\n[WARN] : W/System.err: \tat android.os.Looper.loop(Looper.java:173)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:6698)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: \tat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)\r\n[ERROR] : EnhancedIntentService: binding to the service failed\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Notification Bug on SDK 8.0.0", "creator": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "446030", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you please share the code that you are using for the push receive? Thanks. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-02-12T22:04:09.000+0000", "updated": "2019-02-12T22:04:09.000+0000" }, { "id": "446042", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{code:java}\r\nTi.Android.NotificationManager.createNotificationChannel({\r\n id:'default',\r\n name:'Miscellaneous',\r\n importance:Ti.Android.IMPORTANCE_DEFAULT,\r\n showBadge:true,\r\n enableVibration:true,\r\n enableLights:true\r\n});\r\n\t\t\r\nvar CloudPush = require('ti.cloudpush');\r\n\r\nvar deviceToken = null;\r\n\r\nCloudPush.retrieveDeviceToken({\r\n success:function(e) {\r\n\t deviceToken = e.deviceToken;\r\n\t},\r\n error:function(e) {\r\n\t\t\r\n\t}\r\n});\r\n\r\nCloudPush.showTrayNotificationsWhenFocused = true;\r\nCloudPush.showTrayNotification = true;\r\nCloudPush.focusAppOnPush = false;\r\nCloudPush.singleCallback = false;\r\n\r\nCloudPush.addEventListener('trayClickFocusedApp', function(e) {\t\r\n\tvar data = JSON.parse(e.payload).android;\r\n\tTi.API.info(data);\r\n});\r\n\r\nCloudPush.addEventListener('trayClickLaunchedApp', function(e) {\r\n\tvar data = JSON.parse(e.payload).android;\r\n\tTi.API.info(data);\r\n});\r\n{code}\r\n", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-13T08:37:16.000+0000", "updated": "2019-02-13T08:38:52.000+0000" }, { "id": "446049", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~andreas.pingas], Are you sending a sound with your push notification, did you app have the sound resource inside? what is your cloudpush version? Can you try with the below code, put your credentials in the login. Thanks.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : '#ccc',\r\n title : 'Android Cloud Push Notification'\r\n});\r\n \r\nvar CloudPush = require('ti.cloudpush');\r\nCloudPush.debug = true;\r\nCloudPush.enabled = true;\r\nCloudPush.singleCallback = true;\r\n \r\nvar deviceToken=null;\r\nvar Cloud = require('ti.cloud');\r\nCloud.debug = true;\r\n \r\nvar submit = Ti.UI.createButton({\r\n title : 'Register For Push Notification',\r\n color : '#000',\r\n height : 60,\r\n width : 200,\r\n top : 100,\r\n});\r\n \r\nwin.add(submit);\r\n \r\nsubmit.addEventListener('click', function(e) {\r\n loginDefault();\r\n});\r\n \r\nCloudPush.retrieveDeviceToken({\r\n success : deviceTokenSuccess,\r\n error : deviceTokenError\r\n});\r\n \r\n// Save the device token for subsequent API calls\r\nfunction deviceTokenSuccess(e) {\r\n deviceToken = e.deviceToken;\r\n}\r\n \r\nfunction deviceTokenError(e) {\r\n alert('Failed to register for push notifications! ' + e.error);\r\n}\r\n \r\n// Process incoming push notifications\r\nvar listenersAdded = false;\r\nwin.addEventListener('open', function() {\r\n if (listenersAdded) {\r\n return;\r\n }\r\n \r\n // Process incoming push notifications\r\n CloudPush.addEventListener('callback', function(evt) {\r\n alert(\"Notification received: \" + evt.payload);\r\n Ti.API.info(\"-------> Notification received: \" + evt.payload);\r\n });\r\n \r\n CloudPush.addEventListener('trayClickLaunchedApp', function (evt) {\r\n alert('Tray Click Launched App (app was not running)');\r\n Ti.API.info('-------> Tray Click Launched App (app was not running)');\r\n });\r\n \r\n CloudPush.addEventListener('trayClickFocusedApp', function (evt) {\r\n alert('Tray Click Focused App (app was already running)');\r\n Ti.API.info('-------> Tray Click Focused App (app was already running)');\r\n });\r\n \r\n listenersAdded = true;\r\n});\r\n \r\nfunction loginDefault(e) {\r\n // At first you need to create an user from the application dashboard\r\n // Then login that email and password\r\n Cloud.Users.login({\r\n login : 'sliang@appcelerator.com',\r\n password : '1234'\r\n }, function(e) {\r\n if (e.success) {\r\n alert(\"login success\");\r\n defaultSubscribe();\r\n } else {\r\n alert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n });\r\n}\r\n \r\nfunction defaultSubscribe() {\r\n Cloud.PushNotifications.subscribe({\r\n channel : 'Android Test',\r\n device_token : deviceToken,\r\n type : 'gcm'\r\n }, function(e) {\r\n if (e.success) {\r\n alert('Subscribed for Push Notification!');\r\n } else {\r\n alert('Error:' + ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n });\r\n}\r\nwin.open();\r\n{code}\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-02-13T15:15:01.000+0000", "updated": "2019-02-13T15:15:01.000+0000" }, { "id": "446066", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I use the Android sdk build-tools 28.0.3, to ti.cloudpush 5.2.0, android SDK 28, sound is set to default.\r\n\r\nThe example you have send seems that its always working.\r\n\r\nMy example, on the other hand is not working properly.\r\n\r\nThe CloudPush.retrieveDeviceToken is fired and then i can send one notification only. When the notification reaches the device then the following issue arises and then the device stops receiving notifications. The CloudPush.retrieveDeviceToken process has to take place again in order to start receiving.\r\n\r\n[ERROR] : EnhancedIntentService: binding to the service failed\r\n\r\nI will check if any of the following makes an issue and i will let you know.\r\n\r\nfirebase.core\r\nfirebase.analytics\r\nti.playservices\r\nti.admob", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-14T10:28:44.000+0000", "updated": "2019-02-14T10:28:44.000+0000" }, { "id": "446080", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The bug starts with the var CloudPush = require('ti.cloudpush');\r\nIt does not mean that the GooglePlayServices are loading. They might load a few seconds later.\r\nIf the commands load οne after another all the commands the most probable is that this would not work.\r\n:) A temporary solution i have found is the following and always works:\r\n\r\n{code:java}\r\nvar PlayServices = require('ti.playservices');\t\r\nvar CloudPush = require('ti.cloudpush');\r\n\r\nvar deviceToken = null;\r\n\r\nCloudPush.retrieveDeviceToken({\r\n success:function(e) {\r\n\t deviceToken = e.deviceToken;\r\n\t},\r\n error:function(e) {\r\n\t\t\r\n\t}\r\n});\r\n\r\nCloudPush.showTrayNotificationsWhenFocused = true;\r\nCloudPush.showTrayNotification = true;\r\nCloudPush.focusAppOnPush = false;\r\nCloudPush.singleCallback = false;\r\n\r\nvar isGooglePlayServicesAvailableInterval = setInterval(function() {\r\n\t\r\n\tif (PlayServices.isGooglePlayServicesAvailable() == PlayServices.RESULT_SUCCESS) {\r\n\t\tclearInterval(isGooglePlayServicesAvailableInterval);\r\n\r\n\t CloudPush.addEventListener('callback', function(evt) {\r\n\t alert(\"Notification received: \" + evt.payload);\r\n\t Ti.API.info(\"-------> Notification received: \" + evt.payload);\r\n\t });\r\n\t \r\n\t CloudPush.addEventListener('trayClickLaunchedApp', function (evt) {\r\n\t alert('Tray Click Launched App (app was not running)');\r\n\t Ti.API.info('-------> Tray Click Launched App (app was not running)');\r\n\t });\r\n\t \r\n\t CloudPush.addEventListener('trayClickFocusedApp', function (evt) {\r\n\t alert('Tray Click Focused App (app was already running)');\r\n\t Ti.API.info('-------> Tray Click Focused App (app was already running)');\r\n\t });\r\n\t} \r\n\t\t\t\t\t\t\t \r\n}, 500);\r\n{code}\r\n", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-14T21:54:40.000+0000", "updated": "2019-02-14T21:56:45.000+0000" }, { "id": "446192", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~andreas.pingas], You can look into another report of I believe the similar issue TIMOB-18125. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-02-20T17:05:19.000+0000", "updated": "2019-02-20T17:05:19.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }