我可以使用[NSURL URLWithString:@"comgooglemaps://...."]
打开Google地图应用
但是如何打开导航模式?
答案 0 :(得分:1)
此处说明导航模式,"向您的应用添加导航" :https://developers.google.com/maps/documentation/ios-sdk/urlscheme
试试这段代码:
NSURL *testURL = [NSURL URLWithString:@"comgooglemaps-x-callback://"];
if ([[UIApplication sharedApplication] canOpenURL:testURL]) {
NSString *directionsRequest = @"comgooglemaps-x-callback://" + @"?daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York" + @"&x-success=sourceapp://?resume=true&x-source=AirApp";
NSURL *directionsURL = [NSURL URLWithString:directionsRequest];
[[UIApplication sharedApplication] openURL:directionsURL];
}