Flutter IOS FCM通知随机停止工作

时间:2020-08-04 19:31:13

标签: android ios firebase flutter firebase-cloud-messaging

随机通知已在IOS上停止工作。

  1. 使用firebase_messaging:^ 6.0.16。

  2. FirebaseAppDelegateProxyEnabled设置为“否”,并尝试使用false。

  3. 在didFinishLaunchingWithOptions

if (@available(iOS 10.0, *)) {
  [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;
}
  1. 也尝试过这种方法
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Mixpanel.mainInstance().people.addPushDeviceToken(deviceToken) //For Mixpanel purposes, not needed if not using
    Messaging.messaging().apnsToken = deviceToken //*THIS WAS MISSING*
    super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken) //Not sure if calling super is required, but did anyway
  }

我正在使用FLUTTER的v1.17.5频道稳定版

我从上个星期开始遇到此问题,通知开始并自动中断,在api端显示notRegistered错误,请帮忙。

我几乎尝试了所有方法,但不确定为什么Firebase问题仅出现在IOS方面。

0 个答案:

没有答案