本文介绍了Firebase通知在iOS 11中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款使用Firebase推送通知的应用。它一直运行良好,直到我在iOS 11中尝试。使用带有ios 11的iphone,通知无法到达。这是我的代码:

I'm developing an app that uses Firebase push notifications. It worked well until I tried in iOS 11. Using an iphone with ios 11 the notifications don't arrive. Here's my code:

- (void)application:(UIApplication *)application
  didReceiveRemoteNotification:(NSDictionary *)userInfo
  fetchCompletionHandler:(void (^)
  (UIBackgroundFetchResult))completionHandler {
      //Manage notification
  }

- (void)userNotificationCenter:(UNUserNotificationCenter *)center
   willPresentNotification:(UNNotification *)notification
     withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
    //Manage notification
}

这两种方法都没有被调用。

Neither of the methods are called.

感谢您的帮助!

推荐答案

这是Firebase的一个问题。它似乎与他们最近的更新而不是iOS 11有关。他们正在修复它。

This is an issue with Firebase. It seems to be related to a recent update of theirs instead of iOS 11. They are working on a fix for it.

同时添加 pod'FirebaseInstanceID','2.0.0'到你的podfile它将修复它。

In the meantime if you add pod 'FirebaseInstanceID', '2.0.0' to your podfile it will fix it.

你可以在这里阅读更多:

You can read more here: https://github.com/firebase/quickstart-ios/issues/327#issuecomment-332655731

这篇关于Firebase通知在iOS 11中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 14:30