initialize method

Future<Parse> initialize(
  1. String appId,
  2. String serverUrl, {
  3. bool debug = false,
  4. String? appName,
  5. String? appVersion,
  6. String? appPackageName,
  7. String? locale,
  8. String? liveQueryUrl,
  9. String? clientKey,
  10. String? masterKey,
  11. String? sessionId,
  12. bool autoSendSessionId = true,
  13. SecurityContext? securityContext,
  14. CoreStore? coreStore,
  15. Map<String, ParseObjectConstructor>? registeredSubClassMap,
  16. ParseUserConstructor? parseUserConstructor,
  17. ParseFileConstructor? parseFileConstructor,
  18. List<int>? liveListRetryIntervals,
  19. ParseConnectivityProvider? connectivityProvider,
  20. String? fileDirectory,
  21. Stream<void>? appResumedStream,
  22. ParseClientCreator? clientCreator,
})

To initialize Parse Server in your application

This should be initialized in MyApp() creation

Parse().initialize(
       "PARSE_APP_ID",
       "https://parse.myaddress.com/parse/,
       clientKey: "asd23rjh234r234r234r",
       debug: true,
       liveQuery: true);

Implementation

Future<Parse> initialize(
  String appId,
  String serverUrl, {
  bool debug = false,
  String? appName,
  String? appVersion,
  String? appPackageName,
  String? locale,
  String? liveQueryUrl,
  String? clientKey,
  String? masterKey,
  String? sessionId,
  bool autoSendSessionId = true,
  SecurityContext? securityContext,
  CoreStore? coreStore,
  Map<String, ParseObjectConstructor>? registeredSubClassMap,
  ParseUserConstructor? parseUserConstructor,
  ParseFileConstructor? parseFileConstructor,
  List<int>? liveListRetryIntervals,
  ParseConnectivityProvider? connectivityProvider,
  String? fileDirectory,
  Stream<void>? appResumedStream,
  ParseClientCreator? clientCreator,
}) async {
  final String url = removeTrailingSlash(serverUrl);

  await ParseCoreData.init(
    appId,
    url,
    debug: debug,
    appName: appName,
    appVersion: appVersion,
    appPackageName: appPackageName,
    locale: locale,
    liveQueryUrl: liveQueryUrl,
    masterKey: masterKey,
    clientKey: clientKey,
    sessionId: sessionId,
    autoSendSessionId: autoSendSessionId,
    securityContext: securityContext,
    store: coreStore,
    registeredSubClassMap: registeredSubClassMap,
    parseUserConstructor: parseUserConstructor,
    parseFileConstructor: parseFileConstructor,
    liveListRetryIntervals: liveListRetryIntervals,
    connectivityProvider: connectivityProvider,
    fileDirectory: fileDirectory,
    appResumedStream: appResumedStream,
    clientCreator: clientCreator,
  );

  _hasBeenInitialized = true;

  return this;
}