Firebase推送通知无法在iOS上进行生产 [英] Firebase push notifications not working for production on iOS

查看:415
本文介绍了Firebase推送通知无法在iOS上进行生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Firebase Messaging SDK集成到我的iOS项目中,创建了一个用于开发的推送通知证书和一个用于生产的推送通知证书,将两个p12密钥上传到Firebase并且我没有收到通知,但仅用于开发。

I integrated Firebase Messaging SDK into my iOS project, created a push notification certificate for development and one for production, uploaded both p12 keys to Firebase and I do not receive the notifications, but just for development.

注册代码很好,和我常用的APNS一样,工作正常。

The code for registration is good, and it is the same I used for usual APNS, which worked fine.

同样的行为发生3个申请。

The same behaviour happens for 3 applications.

其他人是否遇到此问题?你有任何解决方案或建议吗?

Did someone else encounter this problem? Do you have any solutions or suggestions?

推荐答案

我遇到了同样的问题。显然,Firebase文档中存在错误。 当您将生产的APN证书从钥匙串导出到.p12文件时,您必须选择实际的证书,私钥

I had the same issue. Apparently there is an error in the Firebase documentation. When you exporting the APN certificate for production from your keychain to the .p12 file you have to select the actual certificate, not the private key.

确保您在Cloud Messaging APN证书设置中将此.p12文件上传到Firebase控制台。

Make sure you upload to the Firebase console this .p12 file in the Cloud Messaging APN certificate settings.

还要确保你正在使用:

FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: .prod)

内部:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)

这篇关于Firebase推送通知无法在iOS上进行生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆