objective c - How can I open Google Maps URL Scheme on iOS? -
as google map sdk doc description, can use code below call native google maps finish directions. how can test these code on xcode? 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://"); }
if ios 9 might want try this: under info custom ios taget properties, lsapplicationqueriesschemes. add comgooglemaps
Comments
Post a Comment