-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
I'm getting those error when using FCM plugin in IOS, anyone know why and how I can solve this issue ?
════════════════════════════════════════════════════════════════════════════════════════════════════
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method requestNotificationPermissions on channel plugins.flutter.io/firebase_messaging)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#2 FirebaseMessaging.requestNotificationPermissions (package:firebase_messaging/firebase_messaging.dart:87:21)
#3 _HomeState.getIOSPermission (package:in_jesus_name/screens//home.dart:153:24)
#4 _HomeState.configurePushNotificationsFirebaseUser (package:in_jesus_name/screens//home.dart:227:7)
<asynchronous suspension>
#5 _HomeState.handleFirebaseSignIn (package:in_jesus_name/screens//home.dart:143:9)
<asynchronous suspension>
#6 _HomeState.initState.<anonymous closure> (package:in_jesus_name/screens//home.dart:822:7)
#7 _rootRunUnary (dart:async/zone.dart:1192:38)
#8 <…>
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getToken on channel plugins.flutter.io/firebase_messaging)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#2 FirebaseMessaging.getToken (package:firebase_messaging/firebase_messaging.dart:150:27)
#3 _HomeState.configurePushNotificationsFirebaseUser (package:in_jesus_name/screens//home.dart:245:24)
#4 _rootRunUnary (dart:async/zone.dart:1192:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#9 Future._completeWithValue (dart:async/future_impl.dart:526:5)
<…>
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel plugins.flutter.io/firebase_messaging)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#2 FirebaseMessaging.configure (package:firebase_messaging/firebase_messaging.dart:114:14)
#3 _HomeState.configurePushNotificationsFirebaseUser (package:in_jesus_name/screens//home.dart:250:24)
#4 _rootRunUnary (dart:async/zone.dart:1192:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#9 Future._completeWithValue (dart:async/future_impl.dart:526:5<…>
Here my flutter doctor :
flutter doctor -v
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.4 19E287, locale fr-FR)
• Flutter version 1.17.4 at /Users/jeremydormevil/SDK/flutter
• Framework revision 1ad9baa8b9 (2 weeks ago), 2020-06-17 14:41:16 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/jeremydormevil/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• iPhone SE (2nd generation) • C3648C6D-68FB-47FA-A311-7D398AFF4540 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
• No issues found!
And a code sample where those error came from :
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method requestNotificationPermissions on channel plugins.flutter.io/firebase_messaging)
getIOSPermission() {
_firebaseMessaging.requestNotificationPermissions(
IosNotificationSettings(alert: true, badge: true, sound: true));
_firebaseMessaging.onIosSettingsRegistered.listen((settings) {
print("Settings registered:$settings");
});
}
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getToken on channel plugins.flutter.io/firebase_messaging)
_firebaseMessaging.getToken().then((token) {
print("Firebase Messaging Token: $token\n");
usersRef.document(firebaseUser.uid).updateData({"FCMToken": token});
});
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel plugins.flutter.io/firebase_messaging)
_firebaseMessaging.configure(
onLaunch: onPush,
onResume: onPush,
onMessage: onPush,
onBackgroundMessage: Platform.isIOS ? null :onBackgroundPush,
);
}
here my AppDelegate.swift
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Metadata
Metadata
Assignees
Labels
No labels