{ "id": "170238", "key": "TIMOB-25485", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2018-08-08T08:43:25.000+0000", "created": "2017-11-07T02:59:43.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-08T08:43: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": "[openURL|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform-method-openURL] method can open the URL but it returns false. It should return true \r\n\r\nh6.Testing Environment:\r\niOS Device version v11.0.3\r\nTi SDK 6.3.0\r\n\r\nIt seems deprecated natively for (iOS 2.0–10.0)\r\n- https://developer.apple.com/documentation/uikit/uiapplication/1622961-openurl?language=objc\r\n\r\nh6.Test Code\r\n\r\n{code:javaScript}\r\nfunction doClick(e) {\r\n\tvar success = Ti.Platform.openURL('http://my.jbhunt.com/c/document_library/get_file?p_l_id=26083956&folderId=27970378&name=DLFE-207201.pdf');\r\n\tTi.API.info('success: ' + success);\r\n}\r\n\r\n$.index.open();\r\n\r\n{code}\r\n\r\n\r\n{code:java}\r\n[INFO] : success: false\r\n[INFO] : success: false\r\n{code}\r\n\r\n\r\n\r\nThanks", "attachment": [], "flagged": false, "summary": "iOS: Ti.Platform.openURL method always returns false on iOS", "creator": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": null, "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "430226", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Customer has also said that it affects previous SDK versions. The link will open but return the status as failed. So when the user returns to the app the app thinks the link failed. ", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-07T17:04:56.000+0000", "updated": "2017-11-07T17:04:56.000+0000" }, { "id": "430231", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We would be able to add the native {{openURL:options:completionHandler:}} API as a new feature in upcoming versions of the SDK. In either case, checking if a URL can be opened should be done using {{canOpenURL}} instead. A proposed API would be:\r\n{code:js}\r\nTi.Platform.openURL('my_url', function(e) {\r\n if (!e.success) {\r\n Ti.API.error('Error opening URL!');\r\n }\r\n});\r\n{code}\r\n[~jquick] Does Android have something, too? An asynchronous solution should be important to not block the main-thread on this.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-07T18:09:41.000+0000", "updated": "2017-11-07T18:09:41.000+0000" }, { "id": "430232", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], there's no equivalent to this on Android that I'm aware of. You're only option is to call queryIntentActivities(), which is the closest equivalent to canOpenURL() on Android. You then call Context.startActivity() (which we do for Ti.Platform.openURL()) and hope that the query didn't lie to you. Although the OS will display an alert stating that an app for the intent wasn't found in such a case, but there's no feedback to the code when this happens.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-07T18:21:23.000+0000", "updated": "2017-11-07T18:21:23.000+0000" }, { "id": "430298", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~morahman], the canOpenURL() function determines if the URL \"scheme\" can be opened. It should return true for your \"http://\" case because the Safari browser accepts \"http:\" schemes. It won't check if the website is valid because that can only be done by the web browser via an asynchronous HTTP request.\r\n\r\nYou typically use canOpenURL() with custom URL schemes registered by installed apps, such as \"twitter:\" for the Twitter app and \"comgooglemaps:\" for Google Maps on iOS.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-08T18:31:09.000+0000", "updated": "2017-11-08T18:36:59.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }