ios Firebase:无法上传生产 APNs 证书
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37786677/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Firebase: Cannot upload production APNs certificate
提问by Robbie Lewis
I am currently testing an app in TestFlight and need a production APNs certificate in order to test Notifications in Firebase.
我目前正在 TestFlight 中测试应用程序,需要生产 APNs 证书才能在 Firebase 中测试通知。
I have followed all of the steps in this video and successfully configured the development APNs certificate: https://www.youtube.com/watch?v=LBw5tuTvKd4
我已按照此视频中的所有步骤操作并成功配置了开发 APNs 证书:https: //www.youtube.com/watch?v=LBw5tuTvKd4
I've also checked that my steps following the Firebase support guide. Although I note that the Apple Developer site has changed slightly since this guide was written: https://firebase.google.com/docs/cloud-messaging/ios/certs#configure_an_app_id_for_push_notifications
我还检查了我的步骤是否遵循 Firebase 支持指南。虽然我注意到自本指南编写以来 Apple 开发者网站略有变化:https: //firebase.google.com/docs/cloud-messaging/ios/certs#configure_an_app_id_for_push_notifications
I have generated a production APNs certificate at developer.apple.com using the same method as the development certificate but when I try to upload the .p12 file to Firebase, it gives me the following error:
我使用与开发证书相同的方法在 developer.apple.com 上生成了一个生产 APNs 证书,但是当我尝试将 .p12 文件上传到 Firebase 时,它给了我以下错误:
"The certificate environment did not match. Ensure that you got the right development or production APNS certificate."
“证书环境不匹配。请确保您获得了正确的开发或生产 APNS 证书。”
I'm definitely uploading a .p12 generated from a production APNS certificate, is there something else I need to do for a production certificate?
我肯定上传了从生产 APNS 证书生成的 .p12,我还需要为生产证书做些什么吗?
回答by Robbie Lewis
Solved. The mistake I was making was that I was exporting the "private key" part of the certificate in Keychain Access instead of the "certificate" part. As soon as I re exported the .p12 using the correct row in the list - it worked.
解决了。我犯的错误是我在钥匙串访问中导出证书的“私钥”部分而不是“证书”部分。一旦我使用列表中的正确行重新导出 .p12 - 它就起作用了。
Images to illustrate below credit iOS
图片说明下面信用iOS
Correct method:
正确方法:
回答by vaibby
try this
尝试这个
make .csr file and download cert from developer.apple.com
制作 .csr 文件并从 developer.apple.com 下载证书
while exporting select private key and certificate bothat a same time and export to .p12 with any passphase.
同时导出选择的私钥和证书,并使用任何密码导出到 .p12。
upload tht .p12 file on firebase console.
在 firebase 控制台上上传 .p12 文件。
Thanks
谢谢
回答by iOS
回答by Parvesh chauhan
I am facing the same problem and i have tried all above mentioned solution but nothing works for me than i delete certificate from keychain access and again download certificate and install it than export and try to upload it. It works for me.
我面临同样的问题,我已经尝试了上述所有解决方案,但没有什么比我从钥匙串访问中删除证书并再次下载证书并安装它而不是导出并尝试上传它更有效。这个对我有用。
回答by lorenzo
In my case I wanted to upload a production certificate to Firebase, and after trying everything I finally realized that I had created a development certificate on iOS Developer...
就我而言,我想将生产证书上传到 Firebase,在尝试了一切之后,我终于意识到我已经在 iOS Developer 上创建了一个开发证书......
回答by Chaohsiung Huang
When I tried the solution suggested here, nothing works (This probably means I am doing right). I solved this issue by replacing Chrome (The application is running for a very long time) with Safari (I invoke the application just for this purpose) for the upload.
当我尝试这里建议的解决方案时,没有任何效果(这可能意味着我做得对)。我通过用 Safari 替换 Chrome(应用程序运行了很长时间)来解决这个问题(我调用应用程序只是为了这个目的)进行上传。
That means, if restart Chrome might also work.
这意味着,如果重新启动 Chrome 也可能工作。
FYI.
供参考。
回答by bibscy
There might be an inssue of semantics in some cases, so pay attention to meaning.
When you have to upload the certificates in firebase console there are 2 boxes with placeholder text which read:
1. No development APNs certificate
2. No production APNs certificate
在某些情况下可能存在语义问题,因此请注意含义。
当您必须在 firebase 控制台中上传证书时,有 2 个带有占位符文本的框,内容如下:
1. 没有开发 APNs 证书
2. 没有生产 APNs 证书
In my case, I had understood that I must notupload a development APNs certificate in box 1. Actually, firebase meant that no development Apns certificate has been uploaded yet and that I could upload my certificate.
就我而言,我明白我不能在框 1 中上传开发 APNs 证书。实际上,firebase 意味着尚未上传开发 Apns 证书,我可以上传我的证书。