I am working on developing the cordova HERE map plugin to get route calculation data in app. I am working on adding the functionality for ios. I want to get a maneuver instructions for the route, following is my code to get maneuver instructions for the calculated route.
NSString * language = [[NSLocale preferredLanguages] firstObject]; // getting lang code en
NSArray* inst= [route instructionsForLanguage:language unitSystem:NMARouteInstructionsUnitSystemMetric];
But I don't know why it is returning empty array. Please help it anyone knows how to get maneuver instructions.
That happening because NSLocale
preferredLanguages
can give you language code instead of language and country code, for exampleAccording to HERE maps documentation function expect language code, like
en-US
So to make it easier for you, to need to get language code instead.