SendbirdSdk constructor

SendbirdSdk({
  1. String? appId,
  2. String? apiToken,
  3. Options? options,
})

Implementation

factory SendbirdSdk({
  String? appId,
  String? apiToken,
  Options? options,
}) {
  if (appId == null ||
      (appId == _instance._int.state.appId &&
          apiToken == null &&
          options == null)) {
    return _instance;
  }

  // initialize with different app id, so logout and
  // reinitialize internal obj
  _instance._int.logout();
  _instance = SendbirdSdk._instanceFunction();
  _instance._int = SendbirdSdkInternal(
    appId: appId,
    apiToken: apiToken,
    options: options,
  );

  return _instance;
}