Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create an instance of NMApiCredentials with mandatory parameters (account ID, password, email ID, service ID) with one of the methods provided.

  2. 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, use NMApiKeyTypeDefault API Key Typekey type. Additionally, for a dedicated tile service, a NMApiKeyTypeTiles API Key Type can be providedOptionally, map tiles service may require separate authentication, in this case NMApiKeyTypeTiles API key type should be used.

  3. 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 in NMApiKeyObtainError.

...

If you have a separate key for tile servers, call this method again, passing NMApiKeyTypeTiles as the first second argument:

Objective-C
Code Block
languageobjective-c
NSString *storedApiKey = // Retrieve the stored API key
[navmiiSDK updateApiKey:storedApiKey withType:NMApiKeyTypeTiles];

...