7

I'm currently working on an iPhone Application which allows the user to navigate to POIs. Those POIs are defined via lat/lon, and the user should have the possibility to start his navigation solution with one click to navigate to this POI.

This works fine with Navigon, using URL scheme navigon://myapp|name||||||lat|lon

Now I know that there is an URL scheme named tomtomplus:// for the TomTom iPhone app, I'm only able to start tomtom, no other action is possile.

I tried tomtomhome://geo:action=navigateto&lat=mylat&long=mylon&name=myname - but did not work. Only tomtom app is starting.

Even when I try to go over the http://addto.tomtom.com API, tomtom does only start, no action in adding and POI or chance to navigate to.

Codesniplet:

NSString* launchurl = [NSString stringWithFormat:@"tomtomhome://geo:action=navigateto&lat=%.8f&long=%.8f&name=%@", myEntry.getLon, myEntry.getLat, myEntry.name];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[launchurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];

Any suggestions?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Aemsn
  • 338
  • 4
  • 8

1 Answers1

13

I used Tomtom to send me an email from the route planning option on my iPhone. In that email is a tomtomhome:geo link which I used. To test I clicked on the link on my Mac in Safari, and obviously nothing happened. Then I saved the link as a bookmark, which immediately is synced to my iPhone using MobileMe. I clicked on the bookmark on my iPhone Safari browser and viola Tomtom opens with a map centred to the location in the link. It pops up with a balloon with the links name, and an right arrow allows me to choose first option "Navigate there"

The link generated is:

  • tomtomhome:geo:action=show&lat=26.123456&long=28.123456&name=linkname

  • Yep. You re right - works like a charm. I think my first problem was that the testing coordinates went outside the covered nagigation area. TomTom behaviour is somehow undefined with this. Thank you! – Aemsn May 04 '11 at 12:11
  • 4
    Some extra things I found out: * action=navigateto makes the app calculate the route as soon as it opens * any special characters in the `name=` part should be escaped, or else the `[NSURL URLWithString:]` will fail. – Bob Vork Oct 03 '11 at 12:19
  • 7
    TomTom has a number of apps in the App Store (tomtom us, tomtom canada, brazil, etc). Do they all share the same URL scheme? I can't afford to buy all these apps to test and validate. Do all the apps share tomtomhome: schema? What happens if 2 or more are installed? – Michael Gray Sep 13 '12 at 15:20
  • @MichaelGray Unfortunately, it will open one of those, you don't get to choose... In my case, it opens the wrong one. – Sandman Apr 12 '14 at 14:07
  • @Sandman I believe how it works on iOS in the case of multiple apps with one URL scheme, is that the first app installed gets the open. So you could delete all the apps that share the scheme, then re-install them all with the one you wish to use first. Not ideal, but at least it's one workaround. – William Denniss May 27 '14 at 16:23