initialize method
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,
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;
objectsExistForEventually = await checkObjectsExistForEventually();
if (objectsExistForEventually) {
ParseObject.submitEventually();
}
return this;
}