简体   繁体   English

推送通知在生产证书中不起作用

[英]Push notification is not working in production certificates

I am facing issue during push notifications when app is installed on IOS(8.3) device(iPhone and iPad). 在IOS(8.3)设备(iPhone和iPad)上安装应用程序时,我在推送通知期间遇到问题。

Its working locally(in development). 它在当地工作(在开发中)。 But when I configure the same in production( upload app to app store ). 但是当我在生产中配置相同的内容时(将app上传到app store)。 It is not working. 它不起作用。

These are the configurations that I have done: * In Xcode, in entitlement file, for "APS environment" key i have given value as "production". 这些是我所做的配置:*在Xcode中,在授权文件中,对于“APS环境”键,我将值作为“生产”。 * While creating the SSL certificate i have created the production SSL certificate. *创建SSL证书时,我创建了生产SSL证书。 * In code i have used "withProductionDestination()" method while pushing the notification to APNS. *在代码中,我在将通知推送到APNS时使用了“withProductionDestination()”方法。

I am not geting any error or exceptions while sending the notification payload with token to APNS(both in production and development). 在向APNS发送带有令牌的通知有效负载时(无论是在生产和开发中),我都没有发现任何错误或异常。

I have verified that the notifications feature is active in my account for both development and production. 我已经验证通知功能在我的帐户中处于活动状态,无论是开发还是生产。 I have also verified the certificates and they are correct. 我还验证了证书,它们是正确的。

Can you please let me know what steps I might have missed or doing wrong? 你能告诉我我可能错过或做错的步骤吗?

If you use production certificate for push notifications, you need to remove .sandbox in the apns server address and if you install the app by using Xcode, generally by using run option, then the mode will be set to development and the push notifications from production environment won't be received. 如果您使用生产证书进行推送通知,则需要删除apns服务器地址中的.sandbox,如果使用Xcode安装应用程序,通常使用运行选项,则模式将设置为开发和生产的推送通知不会收到环境。 You need to install the app by generating the .ipa file and install in from iTunes. 您需要通过生成.ipa文件并从iTunes安装来安装应用程序。

Device token for Production (distribution) and Sandbox (developer) are different for same device. 生产(分发)和Sandbox(开发人员)的设备令牌对于同一设备是不同的。

I was also facing the same issue that push notifications were not coming in production and problem was that I was still using device id which I received in developer mode. 我也面临同样的问题,推送通知没有投入生产,问题是我仍在使用我在开发者模式下收到的设备ID。 So, I generated device id again with production certificate and notifications started to come again. 因此,我再次使用生产证书生成了设备ID,并且通知再次开始。

Also, make sure that you access the production environment at this URL gateway.push.apple.com with port 2195. 此外,请确保您使用端口2195访问此URL gateway.push.apple.com上的生产环境。

I had the same issue. 我遇到过同样的问题。 PN's were working on development, but couldn't get them on production. PN正在致力于开发,但无法将它们投入生产。

What helped me: Adding APNS for Distribution Certificate to Firebase. 是什么帮助我:将分发证书的APNS添加到Firebase。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM