{ "id": "175155", "key": "AC-6561", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2020-07-20T14:16:18.000+0000", "created": "2020-06-18T00:29:50.000+0000", "labels": [ "ios" ], "versions": [], "issuelinks": [ { "id": "58566", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "174800", "key": "TIMOB-27846", "fields": { "summary": "iOS: Calling Ti.Platform.openURL without all parameters causes the app to crash (regression)", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58567", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "174876", "key": "AC-6517", "fields": { "summary": "Ti.Platform.openURL throws ERROR (SDK 9.0)", "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" } }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2020-07-20T14:16:19.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": [], "description": "When launching any url with Ti.Platform.openURL on iOS, the app then throws this error:\r\n\r\n{code:java}\r\n[ERROR] Script Error {\r\n[ERROR] message = \"undefined is not an object\";\r\n[ERROR] type = TypeError;\r\n[ERROR] } \r\n{code}\r\n\r\nIt does not provide a stack trace, which is a separate issue. The interesting thing is that it will actually execute the openURL command but then when you return to your Titanium app and execute any subsequent Titanium code, it throws the error.\r\n\r\nAnother user has reported this same issue on [SO|https://stackoverflow.com/questions/62328830/getting-error-after-openurl-on-appcelerator-titanium-v-9], so I do not believe this issue is specific to our app.\r\n\r\nBelow is a simple repro. Launch the app then wait 10 seconds and notice how it correctly opens the apple maps url. Return to the Titanium app and wait another 10 seconds, and notice how the second openURL errors. The second openURL isn't relevant, what is relevant is that Titanium code has executed after the first openURL, and that's enough to cause it to error.\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({ \r\n\ttitle: 'Ti.Platform.openURL Bug'\r\n});\r\nwin.open();\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttop: 100,\r\n\theight: Ti.UI.SIZE,\r\n\ttitle: 'Open maps'\r\n});\r\nbutton.addEventListener('click', function() {\r\n\tTi.Platform.openURL('http://maps.apple.com/maps?q=-8.012960,110.308998');\r\n});\r\nwin.add(button);\r\n\r\nsetInterval(function() {\r\n\tTi.Platform.openURL('http://maps.apple.com/maps?q=-8.012960,110.308998');\r\n}, 10000);\r\n{code}\r\n\r\nAlso of note, I'm not confident that the interval is the ONLY way to cause this error, as I get this error even executing openURL commands not in an interval, but it certainly is easier to reproduce if it is within an interval.\r\n\r\nThis bug exists in Ti SDK 9.0.0+. Ti SDK 8.3.1.GA is the newest version that doesn't have this bug.", "attachment": [], "flagged": false, "summary": "Ti.Platform.openURL causes \"undefined is not an object\" error", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 1201, "state": "closed", "name": "2020 Sprint 14", "startDate": "2020-07-06T15:40:00.000Z", "endDate": "2020-07-17T15:40:00.000Z", "completeDate": "2020-07-20T22:16:28.367Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455889", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "I found a workaround for now from another ticket, specifying the second and third args of openURL:\r\n\r\n{code:javascript}\r\nTi.Platform.openURL('http://maps.apple.com/maps?q=' + destinationAddress, null, () => { });\r\n{code}\r\n", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2020-06-19T02:35:27.000+0000", "updated": "2020-06-19T02:35:27.000+0000" }, { "id": "455944", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Workaround works fine! I had the same error opening a external URL in 9.0.3.GA", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-06-26T11:23:43.000+0000", "updated": "2020-06-26T11:23:43.000+0000" }, { "id": "456174", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Resolved as duplicate of linked ticket. Fix was just pushed to master/9_1_X/9_3_X. Release 9.1.0 will contain it. (or if you really need the fix and don't want to use the empty function callback workaround, you should be able to install a new 9_0_X branch build via {{ti sdk install -b. 9_0_X}} in about an hour once the build goes out)", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-07-20T14:16:19.000+0000", "updated": "2020-07-20T14:16:19.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }