fcm splash bug fixed

This commit is contained in:
MohammadTaha Basiri 2022-03-31 14:16:55 +04:30
parent 56f8b38693
commit 556f010e27
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,8 @@ class UserProvider extends CoreProvier {
} }
if (service.isSuccess) { if (service.isSuccess) {
user = User.fromJson(service.result['user']); user = User.fromJson(service.result['user']);
await _registerFirebaseToken(); AppInitializer.initializeFirebase().then((_) => _registerFirebaseToken());
_registerFirebaseToken();
return true; return true;
} }
throw 'Getting user from API failed!'; throw 'Getting user from API failed!';

View File

@ -15,7 +15,6 @@ class AppInitializer {
StorageService.appDocsDir = StorageService.appDocsDir =
(await getApplicationDocumentsDirectory()).path; (await getApplicationDocumentsDirectory()).path;
StorageService.appTempsDir = (await getTemporaryDirectory()).path; StorageService.appTempsDir = (await getTemporaryDirectory()).path;
await _initializeFirebase();
MediaService.init(); MediaService.init();
} }
} }
@ -62,7 +61,7 @@ class AppInitializer {
} }
} }
static Future<void> _initializeFirebase() async { static Future<void> initializeFirebase() async {
try { try {
await Firebase.initializeApp( await Firebase.initializeApp(
options: const FirebaseOptions( options: const FirebaseOptions(