[AC-6561] Ti.Platform.openURL causes "undefined is not an object" error
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | n/a | 
| Status | Resolved | 
| Resolution | Duplicate | 
| Resolution Date | 2020-07-20T14:16:18.000+0000 | 
| Affected Version/s | n/a | 
| Fix Version/s | n/a | 
| Components | n/a | 
| Labels | ios | 
| Reporter | Justin Toth | 
| Assignee | Christopher Williams | 
| Created | 2020-06-18T00:29:50.000+0000 | 
| Updated | 2020-07-20T14:16:19.000+0000 | 
Description
	When launching any url with Ti.Platform.openURL on iOS, the app then throws this error:
[ERROR] Script Error {
[ERROR]     message = "undefined is not an object";
[ERROR]     type = TypeError;
[ERROR] } 
var win = Ti.UI.createWindow({ 
	title: 'Ti.Platform.openURL Bug'
});
win.open();
var button = Ti.UI.createButton({
	top: 100,
	height: Ti.UI.SIZE,
	title: 'Open maps'
});
button.addEventListener('click', function() {
	Ti.Platform.openURL('http://maps.apple.com/maps?q=-8.012960,110.308998');
});
win.add(button);
setInterval(function() {
	Ti.Platform.openURL('http://maps.apple.com/maps?q=-8.012960,110.308998');
}, 10000);
I found a workaround for now from another ticket, specifying the second and third args of openURL:
Ti.Platform.openURL('http://maps.apple.com/maps?q=' + destinationAddress, null, () => { });Workaround works fine! I had the same error opening a external URL in 9.0.3.GA
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_Xin about an hour once the build goes out)