मुझे एक ही समस्या है लेकिन समन्वय को UIActivityViewController के माध्यम से काम करने के लिए उत्तर नहीं मिला।
कामकाज के रूप में, मैंने व्हाट्सएप में जो कुछ देखा है, उसके लिए मैंने एक समान दृष्टिकोण का उपयोग किया, जहां आपको विभिन्न मानचित्र प्रदाताओं के साथ एक एक्शन शीट मिलती है। निम्न कोड एक अलर्ट दिखाएगा और आपको वेज़/Google मैप्स/ऐप्पल मैप्स के माध्यम से एक विशेष स्थान खोलने का चयन करने देगा - केवल इंस्टॉल किए गए ऐप्स दिखाई देंगे। अपने CLLocationCoordinate2D अक्षांश/देशांतर गुणों के साथ बस "रेखांश" और "अक्षांश" मानों को प्रतिस्थापित करें।
UIAlertController* alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* appleMaps = [UIAlertAction actionWithTitle:@"Open in Maps" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?q=%@,%@", latitude, longitude]]];
}];
UIAlertAction* googleMaps = [UIAlertAction actionWithTitle:@"Open in Google Maps" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"comgooglemaps://?q=%@,%@", latitude, longitude]]];
}];
UIAlertAction* waze = [UIAlertAction actionWithTitle:@"Open in Waze" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"waze://?ll=%@,%@", latitude, longitude]]];
}];
[alert addAction:appleMaps];
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]])
[alert addAction:googleMaps];
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"waze://"]])
[alert addAction:waze];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:nil];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];