`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'),
),
);
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()); }`