mo-ah-dawood / fcm_config

10 stars 12 forks source link

not working in iOS #33

Open Abouassi98 opened 1 year ago

Abouassi98 commented 1 year ago

flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-x64, locale en-EG) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.78.2) [✓] Connected device (3 available) [✓] Network resources

• No issues found!

this is my code : WidgetsFlutterBinding.ensureInitialized(); //await FCMConfig.instance.getInitialMessage(); await FCMConfig.instance.init( alert: true, announcement: true, badge: true, displayInForeground: (_) => true, carPlay: false, criticalAlert: true, options: DefaultFirebaseOptions.currentPlatform, onBackgroundMessage: _firebaseMessagingBackgroundHandler, defaultAndroidChannel: AndroidNotificationChannel('high_importance_channel', 'sunahouse'));

FCMConfig.instance.messaging.getToken().then((token) async { print(token); });

Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); print("Handling a background message: ${message.messageId}"); }

fcm_config: ^3.5.2