适用于iOS的Google Firebase推送通知在生产环境中不起作用 [英] Google Firebase Push Notifications for iOS are not working in production environment

查看:158
本文介绍了适用于iOS的Google Firebase推送通知在生产环境中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Firebase Cloud Messaging API(FCM)将推送通知发送到我的iOS应用程序。
当我使用开发配置文件+开发推送通知(沙箱)证书在设备上测试应用程序时,我可以成功推送通知。

但是我无法使它在生产环境中工作。我使用正确的生产供应配置文件和生产推送通知证书进行了临时生成。并通过iTunes将IPA文件同步到设备进行测试(不是直接从xcode)。我仍然无法接收来自Firebase控制台的推送通知。



我已经将正确的开发和生产证书(带有私钥)上传到了firebase。我仔细检查了每一个可能出错的步骤,但仍然无法找到问题。 有没有办法排除这个问题?或者是不可能将生产环境通知发送到AdHoc构建? 我有同样的问题。显然,Firebase文档中存在错误。当您从钥匙串中导出用于生产的APN证书到.p12文件时,您必须选择实际的证书,而不是私钥。



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


I'm using Google Firebase Cloud Messaging API (FCM) to send push notifications to my iOS app. I could get push-notifications working successfully when I test the app on a device with Development provisioning profiles + development push notification(sandbox) certificates.

However I'm unable to get it working on production environment. I made an ad-hoc build with correct production provisioning profiles and production push notification certificates. And synced an IPA file to a device via iTunes for testing (not directly from xcode). Still I can't receive push notifications from firebase console.

I have uploaded correct development and production certificates (with private keys) to firebase as well. I've double checked every possible step that could go wrong but, still can't find the issue. Is there a way to troubleshoot this issue? Or isn't it possible to get production environment notifications to an AdHoc build?

解决方案

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.

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

这篇关于适用于iOS的Google Firebase推送通知在生产环境中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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