navigateToURL not working on iOS if using custom protocol
Hello, since a similar bug is closed https://github.com/airsdk/Adobe-Runtime-Support/issues/3536 I'm opening a new one because there seem to be some issue with non-http links...
Until AIR 51.1.1.5 we could use on iOS some custom URLs to invoke an external application (Mobile Print Util or other similar drivers).
The url is formed similar to: com.samathosoft.webprint://#deb64#[base64]
a different url which broke with newer AIR is so formed: documentiapp://print/?data=[base64]
Where [base64] could be a (maybe very long) string that represent a text document (no images)
New versions of our apps compiled with AIR 51.2.1.3 do nothing when we press the button that should print invoking navigateToURL. Reverting to the previous version in Testflight works both with Mobile Print Util and with a similar application.
EDIT: manually try to open a very short link works with AIR 51.1.1.5 but doesn't with the version compiled on AIR 51.2.1.3, the url tried is documentiapp://print/ciao
I've also tried AIR 51.2.1.4 and the issue persists.
The code I use is simply ` var url:String = "documentiapp://print/test";
try {
navigateToURL(new URLRequest(url));
}
catch (e:Error) {
trace(e.message);
} ` No errors are thrown, but neither the destination app opens.
I temporarily fixed the issue by explicitly declaring the custom URLs our apps are going to use, in the InfoAdditions
<key>LSApplicationQueriesSchemes</key>
<array> <string>documentiapp</string> <string>com.samathosoft.webprint</string> </array>
without declaring these schemes, in the Console app, I see messages similar to
canOpenURL: failed for URL: "documentiapp://rest_of_the_url"
This differs from the behavior of the "navigateToURL" command in the earlier versions of AIR SDK, that previously allowed to open custom URLs even if not declared, similarly to the native iOS SDK "open" command that allows undeclared URLs:
Unlike this method (canOpenURL), the open(_:options:completionHandler:) method isn’t constrained by the LSApplicationQueriesSchemes requirement. If an app is available to handle the URL, the system will launch it, even if you haven’t declared the scheme.