Firebase推送通知在iOS 11中无效

问题描述 投票:0回答:2

Firebase推送通知一直有效,直到iOS 11发布。现在看起来在iOS 11上我没有得到推送通知。我在podfile中添加了“FirebaseInstanceID”,“2.0.0”这一行。但我仍然没有收到任何通知。

请帮忙。

firebase push-notification firebase-cloud-messaging ios11
2个回答
1
投票

对于仍有问题的人,您可以尝试我的解决方案。我的迅速3项目。在你的podfile中。请按照顺序进行。

pod 'Firebase/Core' pod 'FirebaseMessaging', '2.0.0' pod 'FirebaseInstanceID' , '2.0.0'

在appDelegate文件中,输入此代码

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    print("APNs token retrieved: \(deviceToken)")
    Messaging.messaging().apnsToken = deviceToken
}

卸载应用程序并尝试在您的设备上重建。 (请确保您的测试设备附带了您的开发配置文件)。这对我有用。


0
投票

我能够通过复制示例firebase项目中存在的相同代码来解决iOS 11.1上的推送通知和预定推送通知的问题 - https://github.com/firebase/quickstart-ios/tree/master/messaging

此处给出的步骤很明确,可帮助您解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.