I am having a problem in safari, that it stopped opening native map application in iPhone device from url like http://maps.google.com/maps?saddr=&daddr=, it is always opening google map inside the browser, in new iOS safari browser, where as the same url works fine in older devices.
Any help would be very appreciated..
Thanks.
Contrary to what you find on the internet, you should not use "http://" but should use "maps://". So "http://maps.google.com/?q=paris" will open the Google Maps website but "maps://maps.google.com/?q=paris" will open the native Maps application.
Related
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.
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
To open Google native app you need to write:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"comgooglemaps://"]];
Example :
comgooglemaps://?q=Pizza¢er=37.759748,-122.427135
I just tested this and it worked in pulling up Google Maps instead of the default Apple Maps application.
Testing Maps
However, after deleting the Google Maps app for iOS, the link fails to open anything because that schema is no longer available and doesn't fallback to a generic maps link... almost seems like you would need to provide two links for Google Maps for iPhone and another generic Apple Map link...
Take a look at this.
It works on every device (for ios / android, it will launch google maps app else browser).
For other devices, it will launch browser.
Simple use case would be:
Construct universal map URI (with encoded params)
Use this URL like -
window.open(mapUrl, '_system');
More info for window.open here
My use case required to open existing in app map navigation into some another dedicated maps app (preferably google maps app) for ios and android devices.
I use ionic v1 + cordova for building native apps. Not sure if this is perfect for your use case but hope this helps.
I want to make an plugin like app in iphone for mobile web browser, in which i want to use safari (or any browser) current link and also link which is present on the web page, when i click on it my app should invoke for using targeted link.
I know plugins are not supported in mobile browser,
Can anybody have any solution without jailbreak?
Thanks in advance.
I use the gwt Geolocation-Package (com.google.gwt.geolocation.client.Geolocation) to read the current Location on a gwt client.
All woks fine on iPhone, iPad, Android and the Chrome-Browser on desktop.
But when I use it on Safari (5.1.2) on desktop, the Safari asks if he can use the position. When I click "Allow" I get a PositionError with errorCode 2 (POSITION_UNAVAILABLE).
Has anyone else this problem/solved it?
If you're using a wired connection, that's why. Safari 5 apparently returns an error when navigator.geolocation is used on a wired connection. To test it out, open the console in Safari 5 and try this:
navigator.geolocation.getCurrentPosition(
function(){console.log("Success!")}, function(){console.log("error")}
);
Basically, the Geolocation package is just a wrapper for HTML5's geolocation functionality. In this case, the functionality fails and you get a PositionError.
I'm trying to get an iPhone browser emulator to work on my website so it will work on all platforms. Are there any Javascript snippets that emulate the iPhone browser? I need it to zoom and browse the web, but the bookmark function is not required.
There isn't such a thing, as the iOS browser has a number of differences to any desktop browser.
The closest you could have is an iFrame surrounded by a picture of an iPhone, and instruct people to use Safari 5.
If you're on a Mac, you can use the iOS Simulator. Download Xcode from the App Store and with it comes the iOS Simulator, which also has the Safari app virtually exactly as is on the iPhone.
http://www.browserstack.com/ does exactly that. It ain't perfect, but it works..
I was trying to open the native map application to show direction from Current Location to the given location. Understandably, the url should work on all the smart phones, not just iPhone.
The most common url that can be used for all the phones can be maps.google.com.
For iPhone I have used http://maps.google.com/maps?saddr=Current%20Location&daddr=lat,lon. It works perfectly fine, iPhone opens the map with my Current Location and the destination location and draws direction. But it doesn't work on other devices.
Any suggestion ?
Thanks.
I've written a blog post addressing this topic and how open native map apps, not just the google site. Check it out here : http://habaneroconsulting.com/insights/Opening-native-map-apps-from-the-mobile-browser.aspx