Launch Nokia HERE Maps iOS via API

2019-07-26 10:14发布

问题:

Is there a documented API for launching Nokia's HERE Maps iOS app for turn-by-turn navigation ?

回答1:

here-place://lat,lon e.g. here-place://48.866833,2.355411

to open Here on a given place.

here-route://lat1,lon1,name1/lat2,lon2,name2

to start turn by turn navigation from lat1,lon1 to lat2,lon2.

here-route:///lat2,lon2,name2

to start a turn by turn navigation from the user location to lat2,lon2.

EDIT: It seems that name fields now support URL percent escaping to encode space and other characters (Tested in Here WeGo v2.0.11. Thank you marcel for the head up).



回答2:

Changed to here-location://lat,lon,name in the latest versions (probably 1.2 or so). name is optional.

here-place and here-route give Couldn't open link error, so probably syntax changed there. Maybe you can specify addresses there, but it was out of scope of my research.



回答3:

On HERE WeGo 2.0.20 (537):

  • Open a URL with a custom here-route URL Scheme:
    • //mylocation/latitude,longitude
    • ,URLencoded string as the name of the destination
    • ?ref=<Referrer> referrer (and can be something like your app or company name)
    • &m=w to indicates the routing mode (m=w stands for walk, m=d for drive)

For instance, here-route://mylocation/37.870090,-122.268150,Downtown%20Berkeley? ref=<Referrer>&m=w requests a route by foot to a destination in downtown Berkeley by a company called Referrer.

Source: HERE Developer Mobility On-Demand Technical Solution Paper (page 36)


I've just tested this and it works fine. The most important bit (at least for me) was that /mylocation/ has to be in the URL for HERE WeGo to start navigation from the user's current location (literally the word mylocation has to be there).

You can also use here-route://sourceLat,sourceLon,sourceOptionalName/destLat,destLon,destOptionalName if you don't want to navigate from the user's current location.

I also tested here-location://lat,lon,optionalName and it works fine in the current (latest, see at the top of this answer) version of HERE WeGo (it used to be here-place, but it doesn't work anymore).



回答4:

URL Scheme for an application can be found in the app's Info.plist. In Info.plist -> URL Types -> URL Schemes -> xxxxx

Extracting bundle contents from ipa is easy. Rename file from .ipa to .zip and unzip to extract contents. Right click on DownloadedApp.app and show package contents. You will find Info.plist, icons, compressed nibs, executable, etc there.

For Nokia HERE Maps app it is nok



回答5:

@FKDev

Basically you can replace spaces with %20 sign. Found on NSData & NSURL - url with space having problem or Spaces in a NSURL with variables doesn't load

I preferred too use internal converters shown in the examples

Xcode sample

NSString *sUrl = @"here-route:///52.379189,4.899431,Amsterdam Central
sUrl = [sUrl stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
 NSURL *url = [NSURL URLWithString:sUrl];

C# Sample

var sUrl= Uri.EscapeUriString(@"here-route:///52.379189,4.899431,Amsterdam Central");
var url = new NSUrl(sUrl);

Both sample will be here-route:///52.379189,4.899431,Amsterdam%20Central