Select the application that will download the map

Im opening a card as follows:

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@,%@", destLat, destLong]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; 

Is there a way to choose which application will open the map? For example, Safari, the map app, or the Tom Tom app ...

+1
source share
2 answers

Yes, you must use one of the iPhone URL schemes. Here is a pretty hefty list that can be found here .

Note that you must first check if the application you want to run is available before using a specific URL scheme.

+2
source

If Tom Tom provides some kind of URL scheme, you can try this one. Otherwise, the default URL scheme handlers are hardcoded on the system, and you cannot redefine or modify them, i.e. "Http:" will always open Safari, with the exception of the domains "maps.google.com", etc.

+2
source

Source: https://habr.com/ru/post/1402660/


All Articles