{ "id": "175820", "key": "TIMOB-28275", "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": [ { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" }, { "id": "21212", "description": "", "name": "Release 9.3.3", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-05-18T18:27:27.000+0000", "created": "2020-11-20T12:57:43.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "geolocation", "iOS" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-05-18T18:27:31.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When removing the location event inside the event itself the app will freeze:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nfunction geoL(e) {\r\n\tTi.Geolocation.removeEventListener('location', geoL);\r\n\talert(\"after remove\");\r\n}\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Test'\r\n});\r\nbtn.addEventListener('click', () => {\r\n\tTi.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_WHEN_IN_USE, event => {\r\n\t\tif (!event.success) {\r\n\t\t\talert('No permissions');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tTi.Geolocation.addEventListener('location', geoL);\r\n\t});\r\n});\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nTested with 8.3.1.GA and 9.2.2.GA\r\n\r\nIt looks like a threading issue e.g. in {{startStopLocationManagerIfNeeded}}. A workaround would be\r\n{code}\r\nfunction geoL(e) {\r\n setTimeout(() => {\r\n Ti.Geolocation.removeEventListener('location', geoL);\r\n }, 2000);\r\n\talert(\"after remove\");\r\n}\r\n{code}\r\n\r\nor removing it from a different event e.g. a button click.", "attachment": [], "flagged": false, "summary": "iOS: RemovingEventListener in Location event will freeze App", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1220, "state": "closed", "name": "2021 Sprint 6", "startDate": "2021-03-15T03:31:12.088Z", "endDate": "2021-03-27T03:31:00.000Z", "completeDate": "2021-03-26T19:18:15.760Z", "originBoardId": 114 }, { "id": 1224, "state": "closed", "name": "2021 Sprint 10", "startDate": "2021-05-17T16:31:32.484Z", "endDate": "2021-05-28T16:31:00.000Z", "completeDate": "2021-05-28T22:15:02.543Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "458381", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/12542", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-11T00:59:58.000+0000", "updated": "2021-03-11T00:59:58.000+0000" }, { "id": "458457", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed\r\nWaiting for Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-19T22:01:17.000+0000", "updated": "2021-03-19T22:01:17.000+0000" }, { "id": "458470", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, 10_0_X and 9_3_X branches.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-03-23T18:10:59.000+0000", "updated": "2021-03-23T18:10:59.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }