...
Create an instance of
NMApiCredentials
with mandatory parameters (account ID, password, email ID, service ID) with one of the methods provided.Call the
+ (void)obtainApiKeyWithCredentials:apiKeyType:completion:
method, to request a new API Key. A result is expected to come in the completion block. To request a default key for general SDK usage, useNMApiKeyTypeDefault
API Key Typekey type. Additionally, for a dedicated tile service, aNMApiKeyTypeTiles
API Key Type can be providedOptionally, map tiles service may require separate authentication, in this caseNMApiKeyTypeTiles
API key type should be used.Check received API Key and
NSError
object. Non-empty error instance indicates a failed request. A type of received error. It’s error code corresponds an error type, specified inNMApiKeyObtainError
.
...
If you have a separate key for tile servers, call this method again, passing NMApiKeyTypeTiles
as the first second argument:
Objective-C
Code Block | ||
---|---|---|
| ||
NSString *storedApiKey = // Retrieve the stored API key [navmiiSDK updateApiKey:storedApiKey withType:NMApiKeyTypeTiles]; |
...