Following code was working fine with iOS 8.4 and earlier, but from iOS 9.0 it starts throwing warning as well giving false
always.
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps-x-callback://"]]
It is throwing warning as:
-canOpenURL: failed for URL: "comgooglemaps-x-callback://" - error: "This app is not allowed to query for scheme comgooglemaps-x-callback"
Do anyone having any idea about, why it is failing in iOS 9 and why throwing error as This app is not allowed to query for scheme comgooglemaps-x-callback
, is there any permissions required to query it?
EDIT
I have added following items in my info.plist, but it is still having same problem.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>comgooglemaps-x-callback</string>
</array>
You have to add a LSApplicationQueriesSchemes entry to your Info.plist and list the schemes that you want your app to query.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>urlscheme</string>
<string>urlscheme2</string>
<string>urlscheme3</string>
<string>urlscheme4</string>
</array>
see http://useyourloaf.com/blog/querying-url-schemes-with-canopenurl.html (also contains a Link to the corresponding WWDC15-Session-Video)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With