ios Firebase:InvalidApnsCredential,而证书有效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43515467/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:04:39  来源:igfitidea点击:

Firebase : InvalidApnsCredential while certificates are valid

iossslfirebasefirebase-cloud-messaging

提问by SeikoTheWiz

Small question.

小问题。

I'm trying to send a message to my push notification test app. It's been working in proof of concept several weeks ago on the same application but not anymore.

我正在尝试向我的推送通知测试应用程序发送消息。几周前,它一直在同一个应用程序上进行概念验证,但现在没有了。

I get failure: InvalidApnsCredential and Firebase tell us : "A message targeted to an iOS device could not be sent because the required APNs SSL certificate was not uploaded or has expired. Check the validity of your development and production certificates"

我失败了:InvalidApnsCredential 和 Firebase 告诉我们:“无法发送针对 iOS 设备的消息,因为所需的 APNs SSL 证书未上传或已过期。请检查您的开发和生产证书的有效性”

But when I check in my firebase console, it tells me that dev and prod certificate will be valid for 9 more months.

但是当我检查我的 firebase 控制台时,它告诉我 dev 和 prod 证书的有效期还有 9 个月。

What else could be causing this message?

还有什么可能导致此消息?

Thanks in advance!

提前致谢!

回答by harshal jadhav

In case if others are also facing the issue here are few tips:

如果其他人也面临这个问题,这里有一些提示:

1)Whenever you are stuck with notification issues try sending a push via the GUI console that firebase provide to send notifications

1)每当您遇到通知问题时,请尝试通过 Firebase 提供的 GUI 控制台发送推送以发送通知

2) If your live app at Appstore is not receiving push notification but is receiving notification only when running via Xcode then you have not uploaded the production certificate to firebase console

2) 如果您在 Appstore 上的实时应用没有收到推送通知,而是仅在通过 Xcode 运行时收到通知,那么您还没有将生产证书上传到 Firebase 控制台

3)If you have uploaded both production and development certificates and still notifications are not received then download the latest certificates and upload them again to the firebase console

3)如果您已上传生产和开发证书,但仍未收到通知,请下载最新的证书并再次将其上传到 firebase 控制台

回答by Abhijith

Adding Team id in Firebase worked for me.

在 Firebase 中添加团队 ID 对我有用。

Firebase console -> General -> select your app -> Add TEAM ID

Firebase 控制台 -> 常规 -> 选择您的应用 -> 添加团队 ID

You can find team ID in Apple developer portal :

您可以在 Apple 开发者门户中找到团队 ID:

https://developer.apple.com/account/#/membership

https://developer.apple.com/account/#/membership