Rotem Yakov Rotem Yakov - 1 month ago 109
Objective-C Question

OpenUrl not working on iOS10

My app uses openURL to open Google Maps app.
It works on iOS 9 but not on iOS 10.

I understand that this method was deprecated on iOS 10, and there's a new one with more parameters.
However, I saw everywhere that it should still work, and changing to the new method will only prevent a warning in the xCode.
I also want to still support iOS 9 and lower.

Any help?

Thanks.

Answer

Add LSApplicationQueriesSchemes key in info.plist file.

<key>LSApplicationQueriesSchemes</key>
    <array>
     <string>comgooglemaps</string>
    </array>

Use this....

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://maps.google.com/maps"] options:@{} completionHandler:nil];