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

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

问题描述

我正在使用 Google Firebase Cloud Messaging API (FCM) 向我的 iOS 应用发送推送通知.当我在具有开发配置文件 + 开发推送通知(沙盒)证书的设备上测试应用时,我可以成功获得推送通知.

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.

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

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.

我也将正确的开发和生产证书(带有私钥)上传到了 firebase.我已经仔细检查了每一个可能出错的步骤,但仍然找不到问题.有没有办法解决这个问题?或者无法获得 AdHoc 构建的生产环境通知?

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?

推荐答案

我遇到了同样的问题.显然 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.

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

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