setApiKey method

Future<void> setApiKey(
  1. String situmApiKey
)

Authenticate yourself into our SDK to start positioning, navigating and using further functionalities of our SDK.

Note: This method should only be used if you have called init without the optional parameters Note: After invoking setApiKey, all subsequent calls will be ignored until logout is invoked.

Implementation

Future<void> setApiKey(String situmApiKey) async {
  if (_alreadyAuthenticated) {
    return;
  }
  await methodChannel.invokeMethod(
    "setApiKey",
    <String, dynamic>{
      'situmUser': "---@situm.com",
      // Underlying sdk expects to have a non empty, non null email. But is not used anymore.
      'situmApiKey': situmApiKey,
    },
  );
  _alreadyAuthenticated = true;
}