Illidan
Illidan

Reputation: 4237

How to launch Yandex Maps app on iPhone from external app?

From iPhone app I developing right now, I want to be able to launch external Yandex Maps app (if it installed on the device, of cause), with destination geo location as a parameter.

Is it possible to do and how?

EDIT: Also, how I can know whether Yandex Maps app installed on device?

Thanks!

Upvotes: 0

Views: 1508

Answers (2)

Yusuf terzi
Yusuf terzi

Reputation: 186

This must work.

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"yandexmaps://test"]])
{
CLLocationCoordinate2D location; // Any location

NSString *yaMapsString = [NSString stringWithFormat:@"yandexmaps://maps.yandex.ru/?pt=%f,%f&ll=%f,%f", location.longitude, location.latitude, location.longitude, location.latitude];
NSURL *yamapsUrl = [NSURL URLWithString:yaMapsString];
[[UIApplication sharedApplication] openURL:yamapsUrl];
}

Upvotes: 0

vokilam
vokilam

Reputation: 10313

Try these schemes

yandexmaps://maps.yandex.ru/?ll=37.5959049,55.7390474&z=12
yandexmaps://maps.yandex.ru/?pt=37.5959049,55.7390474

ll - map center, pt - pin location

Upvotes: 2

Related Questions