NSString *urlString = [[NSString stringWithFormat:@"iosamap://path?sourceApplication=无忧养车&sid=BGVIS1&slat=&slon=&did=BGVIS2&dlat=%@&dlon=%@&dname=%@&dev=0&t=0",lat,lon,address] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
CGFloat ios10 = [[UIDevice currentDevice].systemVersion floatValue];
if (ios10 >= 10){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) {
}];
} else{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}
http://lbs.amap.com/api/amap-mobile/guide/ios/route
网友评论