initialize static method

void initialize(
  1. String appId,
  2. String appKey, {
  3. String? server,
  4. LCQueryCache? queryCache,
})

Initialization

Implementation

static void initialize(String appId, String appKey,
    {String? server, LCQueryCache? queryCache}) {
  if (isNullOrEmpty(appId)) {
    throw new ArgumentError.notNull('appId');
  }
  if (isNullOrEmpty(appKey)) {
    throw new ArgumentError.notNull('appKey');
  }

  // Subclass
  LCObject.registerSubclass<LCFile>(LCFile.ClassName, () => new LCFile());
  LCObject.registerSubclass<LCUser>(LCUser.ClassName, () => new LCUser());
  LCObject.registerSubclass<LCRole>(LCRole.ClassName, () => new LCRole());
  LCObject.registerSubclass<LCStatus>(
      LCStatus.ClassName, () => new LCStatus());
  LCObject.registerSubclass<LCFriendshipRequest>(
      LCFriendshipRequest.ClassName, () => new LCFriendshipRequest());

  _httpClient = new _LCHttpClient(
      appId, appKey, server, SDKVersion, APIVersion, queryCache);
}