Google Map Direction using comgooglemaps

3.7k views Asked by At

I am using google map directions I am trying that code but it doesn't work

 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://");
    }

There is always message that "Can't use comgooglemaps:// Is There any additional setting to use this. I have read google doc but there is not such instructions to use any additional setting

1

There are 1 answers

2
Asaf On BEST ANSWER
  1. In order for this URL Scheme to work you need to have the Google Maps app installed.

  2. If you want to use the callback option, you need your app to respond to some URL Scheme. In order to do so, please check this link. After that, pass your custom url scheme in the x-success parameter.