init method
used to initialise the SDK and Firebase
- Note: All the required paramters can be found in google-services.json file downloaded from Firebase console
except
appName
which can be any StringnotificationDataCallback
all notification payload data will be passed to the calling app if this is not null
Implementation
Future<void> init({
required String appName,
required String projectId,
required String firebaseCurrentApiKey,
required String firebaseMobileSdkAppId,
required String firebaseStorageBucket,
String? firebaseUrl,
required String firebaseProjectNumber,
required Function(Map<String, String?>)? notificationDataCallback,
}) async {
Logs.d('started init');
await _initialiseApp(_getFirebaseModel(
appName,
projectId,
firebaseCurrentApiKey,
firebaseMobileSdkAppId,
firebaseStorageBucket,
firebaseUrl,
firebaseProjectNumber,
));
FeedSDK.appName = appName;
Logs.d('ended init');
if (Platform.isIOS) {
_requestPermissionForIos();
}
FeedApiManager.getInstance().register(_appPreferences);
_initialiseNotifications(notificationDataCallback);
_addMessageListener();
}