我正在开发一个使用 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
}
这两个方法都没有被调用。
谢谢您的帮助!
这是 Firebase 的问题。这似乎与他们最近的更新有关,而不是 iOS 11。他们正在修复它。
同时如果您添加pod 'FirebaseInstanceID', '2.0.0'
到你的 podfile 它将修复它。
你可以在这里阅读更多:https://github.com/firebase/quickstart-ios/issues/327#issuecomment-332655731 https://github.com/firebase/quickstart-ios/issues/327#issuecomment-332655731
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)