mo-ah-dawood / fcm_config

10 stars 12 forks source link

Unhandled Exception: LateInitializationError: Field '_localeNotification@885028921' has not been initialized. #22

Closed youssufhebish closed 2 years ago

youssufhebish commented 2 years ago

I get this error after initializing and setting the package

I imported

firebase_core: ^1.10.6 fcm_config: ^3.3.1 firebase_messaging: ^11.2.4 flutter_local_notifications: ^9.1.5

main function

`void main() async{ WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); await FlutterLocalNotificationsPlugin().initialize; await FCMConfig.instance .init( defaultAndroidForegroundIcon: '@mipmap/launcher_icon', //default is @mipmap/ic_launcher defaultAndroidChannel: AndroidNotificationChannel( 'high_importance_channel',// same as value from android setup 'Fcm config', importance: Importance.high, sound: RawResourceAndroidNotificationSound('notification'), ), );

FCMConfig.instance.init( onBackgroundMessage: _firebaseMessagingBackgroundHandler, defaultAndroidChannel: AndroidNotificationChannel( 'high_importance_channel',// same as value from android setup 'Fcm config', importance: Importance.high, sound: RawResourceAndroidNotificationSound('notification'), ), );

runApp(const MyApp()); }`

realkalash commented 2 years ago

Same

mo-ah-dawood commented 2 years ago

Solved : 3.3.2