自定义 URL 方案不起作用! Navigon应用程序交互
这真的让我很沮丧。我使用了 Navigon 本身提供的文档。不幸的是它没有按预期工作。 Navigon 启动,但停在主菜单上。
我所做的就是:
NSString *myTestStr = [NSString stringWithFormat:@"navigon://App|Another place|FRA|75008|PARIS|rue de Turin|17|2.324621|48.881273"];
NSString *navigonStrEsc = [myTestStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"navigonStr: %@", navigonStrEsc);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:navigonStrEsc]];
你知道我的方式有什么问题吗?
多谢!
It is really frustrating me. I used the doc provided by Navigon itself. Unfortunately it doesn't work as expected. Navigon launches, but stops at the main menu.
All I do is this:
NSString *myTestStr = [NSString stringWithFormat:@"navigon://App|Another place|FRA|75008|PARIS|rue de Turin|17|2.324621|48.881273"];
NSString *navigonStrEsc = [myTestStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"navigonStr: %@", navigonStrEsc);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:navigonStrEsc]];
Any ideas what is wrong with my way?
thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最后我找到了正确的解决方案。 Navigon 应用程序交换纬度和经度值的秘密成分。
使用此自定义 url 方案来传递导航目的地坐标(传递的坐标必须位于加载的地图上):
navigon://坐标/YourAppName/经度/纬度
例如:navigon://coordinate/NaviCard/19.084443/47.573305
Finally I figured out the right solution. The secret ingredients that the Navigon app interchanged the latitude and longitude values.
Use this custom url scheme to pass the navigation destination coordinates (the passed coordinates have to be on the loaded map):
navigon://coordinate/YourAppName/longitude/latitude
For example: navigon://coordinate/NaviCard/19.084443/47.573305
嗯,应该可以。这是我的代码:
唯一的区别是,如果安装了 FRA,我的方案会发生变化,然后首选 navigonFRA。
这段代码正在运行。您是否检查过您的 navigon 版本 >= v1.5 ?
hum it should work. Here's my code:
The only diff is that my scheme changes if FRA is installed , then navigonFRA is prefered.
And this code is working. Did you check that your navigon version is >= v1.5 ?
我发现问题,第一个字段(AppName)非常重要。
以下 html 链接现在可以使用:
有关信息:我昨天打电话给 navigon 支持,接电话的女士很无助,而且非常咄咄逼人,我现在正在考虑使用 TomTom :)
I found the problem, the first field (AppName) is pretty important.
The following html link now works :
For informations : I called the navigon support yesterday, the woman who answered was helpless and terribly aggressive, I'm thinking about using TomTom now :)