推送通知适用于 Ad Hoc,但不适用于从 Apple 商店下载的情况

发布于 2024-08-28 13:43:41 字数 546 浏览 8 评论 0原文

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

我使用临时配置文件在生产中成功测试了推送通知。我没有任何问题。当我提交给苹果时,我做的唯一不同的事情是使用应用程序商店分发配置文件。

该应用程序从不询问我(或下载该应用程序的任何其他人)是否想接收推送通知。因此,手机永远不会与我的服务器通信以发送推送令牌(因为 application:didRegisterForRemoteNotificationsWithDeviceToken: 可能从未被调用)。此外,该应用程序不会出现在通知设置下的设置应用程序中。

我可能做错了什么?

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

提交到苹果商店后生成 APN SSL 证书时出现问题

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!

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.

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.

What could I be doing wrong??

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

Problem generating APN SSL certificate after submitting to apple store

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长安忆 2024-09-04 13:43:41

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

aps-environment
生产

如果没有,请确保在生成配置文件之前确实已启用用于生产推送的应用程序 ID。

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

codesign -dvvvv --entitlements - MyCoolApp.app

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-environment
production

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

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

鹤仙姿 2024-09-04 13:43:41

您是否对 ad-hoc 和分发 mobileprovision 文件使用了相同的应用程序 ID?它需要是一个完整的标识符,而不仅仅是部分标识符。

Did you use the same Application ID for both the ad-hoc and the distribution mobileprovision files? It needs to be a complete identifier, rather than just partial.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文