Firebase通知在iOS 11中无效

Jai*_*ela 20 notifications push-notification ios firebase ios11

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

- (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
}
Run Code Online (Sandbox Code Playgroud)

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

谢谢您的帮助!

Jer*_*iah 13

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

在此期间,如果您添加pod 'FirebaseInstanceID', '2.0.0'到您的podfile,它将修复它.

你可以在这里阅读更多内容:https://github.com/firebase/quickstart-ios/issues/327#issuecomment-332655731