...
Code Block | ||
---|---|---|
| ||
NSString *token = @"your-api-token"; [NMSdk obtainApiKeyWithAccountAuthenticationToken:token completion:^(NSString * _Nullable apiKey, NSString * _Nullable newApiTokennewAccountAuthenticationToken, NSError * _Nullable error) { // if (error) { // Handle error // } // if (apiKey && [apiKey lenght] > 0) { // Store the received API key securely // Now you can start the SDK // [navmiiSDK startWithSettings:configurationSettings completion:nil]; // } // Next time pass the key to the SDK via NMConfigurationSettings object // NMConfigurationSettings *configurationSettings = [NMConfigurationSettings new]; // configurationSettings.apiKeys = @{@(NMApiKeyTypeDefault): apiKey}; // [navmiiSDK startWithSettings:configurationSettings completion:nil]; // An optional parameter `newAccountAuthenticationToken` returned in cases // where the account authentication token is near expiry or explicitly changed by the customer. // The SDK must update its internal state to use this new account authentication token // for subsequent API key requests (if applicable). This behavior aligns with the security policy // to maintain secure interactions. }]; }); |
2. Storing the API Key Securely
...