我想通过googgle map App直接打开google map naviagation。 目前我正在使用下面的代码
NSURL *testURL = [NSURL URLWithString:@"comgooglemaps-x-callback://"];
if ([[UIApplication sharedApplication] canOpenURL:testURL]) {
NSString *direction=[NSString stringWithFormat:@"comgooglemaps-x-callback://?saddr=%@,%@&daddr=%@,%@&x-success=sourceapp://?resume=true&x-source=AirApp", @"18.9750", @"72.8258", @"23.0300",@"72.5800"];
NSURL *directionsURL = [NSURL URLWithString:direction];
[[UIApplication sharedApplication] openURL:directionsURL];
}
else {
showAlert(AlertTitle, @"You don't have GoogleMaps App on this device. Please install it.");
//NSLog(@"Can't use comgooglemaps-x-callback:// on this device.");
}
}
但那只显示方向,之后我需要点击App中的导航按钮,是否有任何方式让我可以打开谷歌地图导航 直接