推送通知在开发中工作正常,但设备在生产中未收到通知 [英] Push notifications works fine in development, but device not getting notification in production

查看:30
本文介绍了推送通知在开发中工作正常,但设备在生产中未收到通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我在应用商店中有一个应用.在开发中,一切正常,我收到了我发送的所有通知.我应该提到我们使用 Firebase 进行分析和推送通知,因为我们有 iOS 和 Android 版本的应用程序.Firebase 帐户具有正确的开发和正确的生产 apns 证书,应用程序的功能设置正确以在后台包含推送通知和远程通知.

Ok, so I have an app that is in the app store. In development everything works fine I get all of the notifications that I send. I should mention that we are using Firebase for analyics and push notifications as we have a iOS and Android version of the app. Firebase account has both the correct development and correct production apns cert, the app's capabilities are set correctly to include push notifications and remote notifications in the background.

在管理器窗口中,apns-environement 的权利在上传到应用程序商店或导出应用程序时设置为生产.每当首次安装应用程序并运行警报以允许推送通知时,就会显示.所以我的 apns 证书必须正确配置.我是这家公司的合同工,刚开始3个月,我讨厌这些人用坏眼光看我,但我真的不知道问题出在哪里.我也在使用 Xcode 的自动代码签名选项,并在这台 Mac 上的 Xcode 中使用了正确的配置文件和开发人员帐户.

In the organizer window the entitlement for apns-environement is set to production whenever uploading to the app store or when exporting the app. Whenever the app is first installed and ran the alert to allow push notifications is shown. So my apns certs have to be configured correctly. I am a working on contract for this company, just started 3 months ago, I would hate for these people to look at me in a bad light but I really don't know where the issue is. I am also using Xcode's automatic code signing option, with the correct provisioning profile and developer account signed in the Xcode on this mac.

推荐答案

刚刚经历了这个,不知道你是否解决了这个,

Just went through this and I do not know if you solved this,

我关闭了推送并从苹果开发中心删除了证书,然后重新创建了它们,这使得一切正常.

I turned push off and deleted the certs from apple dev center and created them all over again and this made everything work as it should.

我也将这行代码设置为,

I also had this line of code set to,

FIRInstanceID.instanceID().setAPNSToken(deviceToken as Data, type: FIRInstanceIDAPNSTokenType.sandbox)

当我推送到应用商店时,我会将其更改为 .prod.

I will change it to .prod when I push to the app store.

这篇关于推送通知在开发中工作正常,但设备在生产中未收到通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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