Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
39
rated 0 times [  42] [ 3]  / answers: 1 / hits: 18334  / 12 Years ago, wed, november 7, 2012, 12:00:00

So that mapping links open the maps app like they used to, I want to present a different link depending on whether a user is on iOS 6 or other (iOS 4, 5, Android, whatever).



Something like: -- if on iOS 6.0 or higher, show http://maps.apple.com?q=address, if other, show http://maps.google.com?q=address.



NOTE: I realize you can also call the maps app directly as opposed to via a web link (don't have it handy right now), but that would not fix the issue, since someone on Android or lesser iOS would get no use from that.


More From » google-maps

 Answers
15

You can detect iOS version using the navigator.userAgentstring. Something like:



if(/(iPhone|iPad|iPod)sOSs6/.test(navigator.userAgent)) {
// use apple maps
}


Note that this is in no way future proof, user agent strings can change, and so will the OS. Also AFAIK, google maps via the browser is available on all platforms, including iOS 6.


[#82117] Wednesday, November 7, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elishaannac

Total Points: 28
Total Questions: 97
Total Answers: 101

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
elishaannac questions
Sun, Dec 5, 21, 00:00, 3 Years ago
Mon, Jun 14, 21, 00:00, 3 Years ago
Mon, Jul 22, 19, 00:00, 5 Years ago
Mon, Jul 8, 19, 00:00, 5 Years ago
;