2010-05-08 63 views
0

这真让人沮丧。我使用了Navigon自己提供的文档。不幸的是,它不能按预期工作。 Navigon启动,但停在主菜单。自定义URL方案不起作用! Navigon AppInteract

所有我做的是这样的:

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]]; 

任何想法有什么不对我的路?

非常感谢!

+0

没人?请给我一个提示:) – rdesign 2010-06-07 13:29:47

回答

0

哼,它应该工作。这里是我的代码: 唯一的区别是,如果安装FRA,我的方案会改变,那么navigonFRA是首选。

NSString* scheme = @"navigonFRA"; 
if ((![NavigonApplication isFRInstalled]) && [NavigonApplication isWorldInstalled]) 
    scheme = @"navigon"; 

NSString* urlAsString = nil; 
urlAsString = [NSString stringWithFormat:@"%@://%@|%@|%@|%@|%@|%@|%@|%f|%f", 
       scheme, 
       @"myApp",   // Field1/AppName:Application or Company Name (e.g. AroundMe) 
       thePOI.name,   // Field2/NameOfPOI: Name of POI (e.g. Navigon AG Würzburg) 
       @"FRA",     // Field3/Country: ISO 3166-1 alpha-3 code for country (http://unstats.un.org/unsd/methods/m49/m49alpha.htm) (e.g. DEU) 
       @"",      // Field4/ZipCode: Postalcode, ZIP code of the POIs city (e.g. 97080) 
       thePOI.location.city, // Field5/City: Name of POIs city (e.g. Würzburg) 
       thePOI.location.streetAddress, // Field6/Street:POIs street name (e.g. Berliner Platz) 
       @"",        // Field7/HouseNumber: POIs street/house number (e.g. 11) 
       thePOI.location.longitude,  // Field8/Longitude: Longitude in WGS84 (e.g. 9.870) 
       thePOI.location.latitude];  // Field9/Latitude: Latitude in WGS84 (e.g. 49.938) 

urlAsString = [urlAsString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
NSLog(@"Starting Navigon app with %@", urlAsString); 
NSURL*url = [[NSURL alloc] initWithString:urlAsString]; 
[[UIApplication sharedApplication ]openURL:url]; 
[url release]; 

而且此代码正在工作。你有没有检查你的导航版本是> = v1.5?

0

我发现这个问题,第一个字段(AppName)非常重要。

下面的HTML链接现在工作:

<a href="navigon://Safari|Some nice place||||||9.937156|49.800074">Some nice place</a> 

对于信息:我昨天叫NAVIGON支持,谁回答这个女人很无奈和非常积极的,我在考虑使用TomTom公司现在:)

+0

将第一个字段设置为一个通用的“ - ”也可以运行 – Sergio 2011-12-20 14:52:09

+0

现在你已经称为navigon支持的两年了,但是猜测是什么:当我打电话时,同样的粗鲁的女人仍然在那里;-)只是想知道他们如何让这样一个灌水渠在Navigon的一线支持工作!? – IODEV 2012-06-20 12:00:43

3

最后我想出了正确的解决方案。 Navigon应用程序交换经度和纬度值的秘密成分。

使用此自定义URL方案来传递所述导航目的地坐标(传递坐标必须加载的地图上): NAVIGON://坐标/ YourAppName /经度/纬度

例如:NAVIGON:/ /coordinate/NaviCard/19.084443/47.573305

+0

这实际上工作:)谢谢!你怎么解决这个问题的? – 2013-03-25 12:49:14

+0

我在本PDF中找到它:http://www.navigon.com/portal/common/faq/files/NAVIGON_AppInteract.pdf – 2013-05-23 10:58:31