Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch Google Maps on iPhone via web link?

I am building a site that will have address links as well as image of a map - both of which have a link to Google Maps.

The problem is that when I click on these links using my iPhone - or any address link that shows up in an email, the result is that either the native Apple Maps app opens or the Google Maps in the browser. I want for the native Google Maps app to open every time, and ideally for every user (whose iPhone I have no control of).

If I use the Chrome app for iPhone, then there's a little trick to do this: http://www.redmondpie.com/how-to-set-google-maps-for-iphone-default-app-for-opening-map-links/

But the reality is that the trick above will not open the Google Maps app. It will open the web version of Google Maps inside the Chrome app. Then an icon shows up at the bottom asking if you want to open the native app instead. This is better than nothing, but far from ideal. I appreciate any help. Thank you. BTW, I'd like to do this without jailbreaking the iPhone - I'm looking for a solution that will work with other people's iPhones.

like image 603
Ricardo Parker Avatar asked Aug 14 '13 04:08

Ricardo Parker


People also ask

How do I get Google Maps to open links on my iPhone?

Configuring Gmail on iPhone to Use Google MapsScroll down to the bottom of the menu and tap Settings. On the Settings screen, tap the Default apps option. Under the Navigate from your location and the Navigate between location sections, tap to select Google Maps.

How do I open Google Maps directly from Safari?

Instead, LONG PRESS (press and hold) "View in Google Maps." A new window will open, where you can choose whether to Open in Safari, or Open in "Google Maps." Choose Open in "Google Maps." I hope this helps.

How do I open Google Maps in my browser?

If the Google Maps app is not installed, the map view will open in a mobile browser or in the default Maps app. , followed by Open View in Google Maps. If Google Maps is installed, and the zoom level selected is valid, Google Maps will open and display the same map view.


2 Answers

You can use apple's interface which is a bit more intelligent when using different browsers and devices:

http://maps.apple.com/?q=51.507269,-0.127695

Clicking the above url on the following devices:

iPhone|iPad: Opens Apple maps app

Android: Gives you a choice to open in either Google Maps App or Google maps website

Windows Phone: Opens Google maps mobile website

Windows 8 Desktop: Opens Google maps website

Apple OS Desktop: Opens the new maps app (Mavericks)!!

For more info see: Apple URL Scheme Reference

like image 123
George Filippakos Avatar answered Sep 29 '22 03:09

George Filippakos


To open Google native app you need to write:

[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]]; 

Example :

comgooglemaps://?q=Pizza&center=37.759748,-122.427135

like image 42
Maulik Avatar answered Sep 29 '22 03:09

Maulik