Reputation: 31
AS google map SDK doc description, we can use the code below to call native google maps to finish directions. But how can I test these code on my Xcode? it always return "can't use comgooglemaps://"?
if ([[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:@"comgooglemaps://"]]) {
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:@"comgooglemaps://?center=40.765819,-73.975866&zoom=14&views=traffic"]];
} else {NSLog(@"Can't use comgooglemaps://");
}
Upvotes: 3
Views: 5251
Reputation: 76
If it is iOS 9 you might want to try this: under info custom iOS taget properties, LSApplicationQueriesSchemes. add comgooglemaps
Upvotes: 4
Reputation: 114773
Opening that URL requires the Google Maps app to be installed. You can't install apps from the app store on the simulator (they aren't compiled for x86 as a start), so you will need to test on an actual device
Upvotes: 0
Reputation: 1312
Apple Dev Notes say "NO if no app is available that will accept the URL; otherwise, returns YES."
Make sure you have Google Maps installed, not the default Apple maps App.
Upvotes: 0