推送通知适用于 Ad Hoc,但不适用于从 Apple 商店下载 [英] Push notifications work for Ad Hoc, but not when downloaded from the Apple store

查看:34
本文介绍了推送通知适用于 Ad Hoc,但不适用于从 Apple 商店下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用刚刚获得苹果商店的批准.我下载了它并在我的 iPhone 上安装了它 - 但它看起来推送通知坏了!

My app just got approved for the apple store. I downloaded it an installed it on my iPhone - but it looks like push notifications are broken!

我使用 adHoc 配置文件成功地测试了生产中的推送通知.我没有问题.当我提交给 Apple 时,我唯一做的不同是使用应用商店分发配置文件.

I was successfully testing push notifications in production using an adHoc provisioning profile. I had no problems. The only thing I did differently when I submitted to apple was using an app store distribution profile.

该应用程序从不询问我(或已下载它的任何人)是否要接收推送通知.因此,电话永远不会与我的服务器对话以发送推送令牌(因为 application:didRegisterForRemoteNotificationsWithDeviceToken: 可能从未被调用).此外,该应用程序也不会出现在通知设置下的设置应用程序中.

The application never asks me (or anyone else who has downloaded it) if I want to receive push notifications. Consequently, the phone never talks to my server to send the push token (because application:didRegisterForRemoteNotificationsWithDeviceToken: is presumably never called). Also the application does not appear in the settings app under the notification settings.

我可能做错了什么??

当应用程序正在等待批准时,我在生成生产推送证书时遇到了一些问题.这可能相关吗?

While the app was awaiting approval, I was having some trouble generating my production push certificate. Could this be relevant?

提交给苹果后生成APN SSL证书的问题存储

推荐答案

请确保您已创建生产应用 ID 并在其上启用推送通知.然后为该应用程序创建配置文件.下载并使用文本编辑器打开文件,以确保配置文件包含此键和值:

Be sure you've created your production App ID and have enable push notifications upon it. Then create the provisioning profile for that app. Download and open the file with a text editor to MUST make sure that the profile contains this key and value:

aps-环境生产

如果没有,那么在生成配置文件之前,请确保您确实为生产推送启用了应用 ID.

If not, then make sure you really have enabled the app ID for production push before you generated your provisioning profile.

完成构建后,您可以检查最终构建以验证它是否具有 aps-environment 权利(您正在内部要求"下寻找 aps-environment 代码签名权利):

After you make your build, you can check the final build to verify it has the aps-environment entitlement (you're looking for the aps-environment code signing entitlement under "Internal requirements):

codesign -dvvvv --entitlements - MyCoolApp.app

codesign -dvvvv --entitlements - MyCoolApp.app

这篇关于推送通知适用于 Ad Hoc,但不适用于从 Apple 商店下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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