Link to iPhone map App from HTML page - iphone

Is there a way to link to directions in the iPhone map app from a html page?
We're placing an add in an iPhone app which will link to a mobile page on our website - we'd like to add a directions link, thus far google searches have been unrevealing.

A link to http://maps.google.com/maps will automatically open in the map application
You can set a destination address (daddr) and start address (saddr) in the link:
http://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino
You can see some more options at:
https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html

Here is a javascript function that creates the link:
function mapLink(myAddress) {
return 'http://maps.google.com/maps?q='+escape(myAddress);
}
This works great on the iPhone.

If you use the standard link that would display a map in the browser, it will automatically open in Google Maps on the device. That includes links that show directions.

Use something like:
<a href='maps:daddr=<destination>&saddr=Current%20Location'>Directions</a>
where may be a lat/lon pair (separated by a comma) or a place. Ensure you URI encode the destination to ensure it works.

Related

iOS web app "Open this page in Maps?" popup when trying to open the Maps App

I'm writing an iPhone web app using HTML5/CSS3. I need to embed a link to open a built-in maps app from my web app. To open a location on the map I redirect mobile Safari to URL like this:
http://maps.google.com?q=Business+Name%26+Street+Address+City+State+Zip
In this case if a user taps on this link the iPhone opens up the maps app and displays the location specified in the URL.
But when I need to provide a URL for driving directions to a predefined location:
http://maps.google.com/maps?saddr=1234+1st+ave+portland+or&daddr=Business+Name%26+Street+Address+City+State+Zip
I've encountered a strange situation when in some cases the iPhone displays a pupup message:
Open this page in "Maps"?
with a choice of yes and no, and only if a user taps Yes, the maps opens up with directions. Note that this popup shows only for some addresses.
Is there any way to prevent this popup from showing at all?
I've created simple web page. Put a link and set google map link with query string value of particular address on src attribute of link element,run it to my iPhone 4.It is working fine, I'm not getting any window to ask it open on map app.
I noticed that you've used "saddr" as a query string parameter. You can replace that with "q" query string parameter.

Links to access phone features from browser

I know that I have seen something like this in somewhere...But no remember where.
Does somebody know what are the features of a smartphone(iphone, android, blackberry) that I can access from a Web Browser?
In some place I had see a list of links that can access different features of the phones(too many).
I mean, I know some things like:
Link Text
Link Text
Link Text
but, is it there something like:
Link Text ???? OR
Link Text ????
Thank for your answers!!
For iOS, it all works via a system called URL Schemes. Checkout this website which even builds the right link for you in HTML.

Custom URL scheme embedded in an SMS on iPhone

Has anyone been able to successfully embed a custom url scheme in an SMS (for example someApp://), such that the iPhone upon receiving the SMS creates a clickable link to launch an app?
There are various questions similar to this out here, however, I have not seen a working solution.
Thanks
In general a custom URL scheme is the way to solve this problem. However, this is complicated by the fact that in iOS 5 (and up through iOS 5.1.1 based on my recent testing), Apple introduced a bug into their Messages app so that custom URLs received via SMS are not recognized as links.
See Custom URL scheme not recognized as link in SMS app(only in iphone 4 iOS 5.0)
You have to create URL scheme which starts with http, https or www.
but http:// and https:// will not work in URL scheme, so If you want create a click able link, you have to set your URL scheme with www.
For eg. www.myapp then the link which can open your app will be www.myapp:// but in this case only www.myapp will be click able and :// will not be click able.
For this use this format for URL scheme
www.<characters1>.<characters2>
www.my.app //example
Now use this format to open your app with click able URL:-
www.<characters1>.<characters2>://<anyThingYouWantToAppend>
www.my.app://open //example
www..:// is enough to open your app, but we are appending anyThingYouWantToAppend to create click able URL.
In my case on iOS 6, the link is not blue if sent from a custom sender ie text instead of a number. As soon as we started using a shortnumber as sender instead of a custom name, it was recognized as a link.
Assuming you have defined a custom url scheme as someApp:// you create a link in an SMS as follows:
"someApp://Myurl"

Link directly to Google Maps transit directions mobile site

If you visit maps.google.com on a mobile device, then press 'Menu', 'Get Directions', and select the 'transit' option, you are taken to a page where you can enter two locations and a date/time, and get directions on public transit. However, the URL is still maps.google.com.
Is there any way to link directly to this page so that I can load it in a UIWebView in my iOS app? Would 'clicking' the buttons in Javascript be (the only/a good) solution?
Try: http://www.google.com/transit
Even clicking the buttons in javascript doesn't seem to be working. The Google Maps code is a little strange- the event listeners aren't assigned directly and I can't get a .click() to work. So what I'll do is have the user enter the two locations in boxes in the app, then load something like http://maps.google.com/maps?f=d&source=s_d&saddr=Coover+Hall&daddr=lied+rec+center in the UIWebView, except I'll add some more specific location information before building the URL, since this is a city-specific app. Not a perfect solution but it gets the job done.
You could create a URL that links to the transit directions with the "dirflg=r" paramater.
Find the other URL parameters here: http://web.archive.org/web/20110714031648/http://mapki.com/wiki/Google_Map_Parameters

iphone - opening an artist link on an application

I am trying to open an "artist link" on an iPhone application but it is not working. The link is to be inside a local HTML file.
I have tried to use "http://phobos...." or "itms://...." but it seems to be not working.
Yes, I am aware of this apple doc, but what is written on this doc does not seams to work for artist links.
Before answering generically, try this. Open itunes and make a search for your name. Right click on your name and copy the link. This is my link. Use this link inside a local HTML on your app and see if it opens. I cannot get mine to work.
I am using the technique and the methods mentioned on the apple doc to make all the redirections but I see the message CANNOT OPEN ITUNES. (itunes ?)
any clues? thanks for any help.
Try either one of these instead of copying the link from itunes, just replace the end part of the URL with the relevant artist name.
Artist’s name or App Store developer’s name: http://itunes.com/Artist_Or_Developer_Name
Album name: http://itunes.com/Artist_Name/Album_Name
App Store apps: http://itunes.com/app/App_Name
Movies: http://itunes.com/movie/Movie_Title
TV show: http://itunes.com/tv/Show_Title