{ "id": "159110", "key": "AC-3424", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-04-05T20:53:32.000+0000", "created": "2016-03-29T15:26:17.000+0000", "labels": [ "android", "cloudpush", "trayClickFocusedApp" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-04-05T20:53:32.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": "Code: \r\n{code:java}\r\nCloudPush.addEventListener('trayClickFocusedApp', function(evt) {\r\n\talert(\"In trayClickFocusedApp event\");\t\r\n\r\n\t//Ti.App.fireEvent('TimelineRefresh');\r\n\r\n\t// Ti.App.fireEvent('messageRefresh', {\r\n\t//\r\n\t// });\r\n\t// Ti.App.fireEvent('listViewPhotoRefresh', {\r\n\t//\r\n\t// });\r\n\t// Ti.App.fireEvent('listViewRefresh', {\r\n\t//\r\n\t// });\r\n\r\n});\r\n{code}\r\n\r\n\r\nIn above code only alert() gets executed & if i uncomment those fireEvents, trayClickFocusedApp Event doesn't get called. \r\n\r\n\r\nVersion Used:\r\nCloudPush : 3.4.1\r\nTitanium SDK : 5.2.0\r\n", "attachment": [ { "id": "58755", "filename": "0-neu-d5-2f9fb89c7a021928872d1f453ee9ac86.jpg", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-29T20:28:06.000+0000", "size": 39795, "mimeType": "image/jpeg" }, { "id": "58754", "filename": "0-neu-d5-729d0f7ecf240d71248b99b7fd452d1f.jpg", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-29T20:27:26.000+0000", "size": 37028, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "In trayClickFocusedApp eventListener only alert() is getting executed. Other Functions, fireEvents, etc. are not getting called inside eventListener.", "creator": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "subtasks": [], "reporter": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "environment": null, "comment": { "comments": [ { "id": "380977", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tried to reproduce the issue with SDK 5.2.1.GA. I can’t reproduce this issue. I have tested with Android 5.0.2. Below is the code that I am using.\r\n\r\n{code}\r\nCloudPush.addEventListener('trayClickFocusedApp', function(evt) {\r\n\talert(\"In trayClickFocusedApp event\");\t\r\n Ti.API.info('Tray Click Focused App (app was already running)');\r\n \r\n function myFunction() {\r\n alert(\"my function\");\r\n } \r\n \r\n myFunction();\r\n \r\n});\r\n{code}\r\n\r\nBoth alert (trayClickFocusedApp and myFunction) was fired successfully. See the attachments. Also, in the console I got the response.\r\n\r\n{code}\r\n[INFO] : Tray Click Focused App (app was already running)\r\n{code}\r\n\r\nI would suggest, defining your functions somewhere in the code and call the functions (as I did) inside the \"trayClickFocusedApp\" event listener. \r\n\r\nAlso, Please share with us the full code that you are using. \r\n\r\nRegards, \r\nSharif\r\n\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-29T20:42:15.000+0000", "updated": "2016-03-29T20:42:15.000+0000" }, { "id": "381034", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hello Sharif,\r\n\r\nThanks for your response.\r\nI noticed following behaviour wrt above Event.\r\n\r\n*Run1:*\r\n* Launched my app\r\n* Put it in background\r\n* Generated notifications\r\n* On click of notification, app gets focused but the fireEvents didn't get executed.\r\n* Exited my app.\r\n\r\n*Run2:*\r\n* Launched my app again\r\n* Put it in background\r\n* Generated notifications\r\n* Now on click of notification, the fireEvents & other codes gets executed on 2nd run.\r\n\r\nThanks & Regards,\r\nSuraj Datta.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-03-30T12:13:25.000+0000", "updated": "2016-03-30T12:13:25.000+0000" }, { "id": "381035", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hello Sharif,\r\n\r\nCan you please test the above behaviours?\r\n\r\nRegards,\r\nSuraj Datta.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-03-30T12:15:43.000+0000", "updated": "2016-03-30T12:15:43.000+0000" }, { "id": "381053", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~Suraj Datta],\r\n\r\nI have tested again following the steps you have mentioned above. I wasn't able to reproduce your issue. Here is how I have tested it.\r\n\r\n 1.Build with SDK 5.2.1.GA.\r\n 2.Launched my app.\r\n 3.Put the app in background.\r\n 4.Generated notifications.\r\n 5.On click of notification, app gets focused myFunction(); get executed.\r\n 6.Console shows trayClickFocusedApp fired.\r\n\r\nRegards,\r\nSharif", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-30T15:51:24.000+0000", "updated": "2016-03-30T15:51:24.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }