Do TomTom or Navigon apps register a URL Handler on the iPhone?
I'd like to use routing from my app, so that TomTom or Navigon get opened with right "from" and "to" addresses. Does anybody know if TomTom or Navigon apps register a URL Handler开发者_运维技巧 on the iPhone?
Navigon offers a PDF presentation with the details of their scheme, which they call AppInteract. I have not seen anything similar from TomTom so far.
If you have access to the application bundles (in other words, you own the applications so the iTunes bundles are in ~/Music/iTunes/Mobile Applications), you can unzip these .ipa bundles and take a look at their Info.plist files.
You should look to see if there are any URL schemes defined by looking for any values in an array at ["CFBundleURLTypes"]["CFBundleURLSchemes"]. You can take a gander at http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html for a more in-depth explanation.
Even if you determine that the applications are built to handle special URL schemes on the devices, you likely won't be able to determine what you would actually need to provide in a URL to get the applications to do anything useful. In other words, even if you knew that the TomTom app handled URL requests of the type "tomtom://", you wouldn't know what to do with that. It could expect all kinds of different information in an arbitrary arrangement in the URL.
Barring access to the application bundles, I suppose you could attempt to contact TomTom or Navigon directly. You'd likely need to contact them anyway to determine how exactly to use any URL handlers that you discover from digging though the IPA bundles.
Check out akosma's wiki: IPhone URL Schemes
Don't bother with NAvigon. That AppConnect PDF is all but vanished now and we ran into a dead end after phoning Germany for support. We were able to get Navigon to launch when tapping a street address from our app, but it would not route or do anything - just open.
I am currently researching if any of the other vendors will. I am on hold as I type this with Tom Tom support.
For Navigon, this works in my app Taskly
NSString *urlString = [NSString stringWithFormat:@"navigon://YourAppName|%@||||||%f|%f",destinationName,destination.longitude,destination.latitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
I've verified the ipa and TomTom actually implements some url schemes, like tomtomhome:// and tomtomTWOLETTERCOUNTRYCODE:// but I was unable to obtain further documentation.
I wrote to TomTom requesting documentation and will update my answer should I get some.
Yes, but don't bother with the TomTom one. They run an HTTP redirect service (Add to TomTom) that will create the correct format URL. That service not only has a more stable API, it also supports their own navigation devices.
精彩评论