{ "id": "124873", "key": "TIMOB-16246", "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": "2014-01-16T16:02:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "event", "sync" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "36070", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "128108", "key": "AC-1067", "fields": { "summary": "Ti.App.fireEvent behaves differently on iOS and Android", "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": "2018-02-28T20:03:32.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "I noticed on android that when you fire a Ti.App event, titanium first executes the handler of the event and then it goes on with the flow after the firing of the event. This makes not sense and is not in parity with iOS.\r\n\r\nsimple example demonstration:\r\n{code}\r\nTi.App.addEventListener(\"test\", function( e ) {\r\n\tconsole.log(\"test event received\");\r\n});\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:\"white\",\r\n\tnavBarHidden:true\r\n});\r\n\r\nTi.App.fireEvent(\"test\", {});\r\nconsole.log(\"test event fired\");\r\nwin.open();\r\n{code}\r\n\r\nh5. Result:\r\n\r\ntest event received\r\ntest event fired\r\n\r\nh5. Expected result: \r\ntest event fired\r\ntest event received\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Android handles Ti.App events synchronously but iOS does not", "creator": { "name": "ktiniatros", "key": "ktiniatros", "displayName": "Onoma Epitheto", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "ktiniatros", "key": "ktiniatros", "displayName": "Onoma Epitheto", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK 3.1.3.GA, 3.2.0.GA", "comment": { "comments": [ { "id": "288794", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce the issue with the provided test case. \r\n\r\niOS\r\n---\r\nWe get the same output as below irrespective of the ordering of following statements.\r\nTi.App.fireEvent(\"test\", {});\r\nconsole.log(\"test event fired\");\r\n\r\n[INFO] : test event fired\r\n[INFO] : test event received\r\n\r\nAndroid\r\n--------\r\nWe get different output as below depending on the ordering of following statements.\r\n\r\nTi.App.fireEvent(\"test\", {});\r\nconsole.log(\"test event fired\");\r\n[INFO] : test event received\r\n[INFO] : test event fired\r\n\r\nconsole.log(\"test event fired\");\r\nTi.App.fireEvent(\"test\", {});\r\n[INFO] : test event fired\r\n[INFO] : test event received\r\n\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-20T07:20:11.000+0000", "updated": "2014-01-20T07:20:11.000+0000" }, { "id": "321883", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces\r\n\r\nTitanium SDK version 3.4.0 master, 3.2.0.GA\r\nTitanium Studio, build: 3.3.0.201407100905\r\nTitanium Command-Line Interface\r\nCLI version 3.3.0, \r\nAndroid device : Motorola Moto G, Android version : 4.4.4\r\niOS simulator : iPhone Retina (3.5-inch), iOS 7.0.3\r\n", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-04T18:53:04.000+0000", "updated": "2014-09-04T18:53:04.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }