推送通知不起作用
我正在尝试向自己发送推送通知。
我已经从苹果复制了代码。但我收到错误没有为应用程序找到有效的“aps-environment”权利字符串。
我使用相同的代码创建了一个新项目(没有添加 entitlements.plist)并且它工作正常。 所以这不是我的配置文件或我的代码的问题,那么是什么?
有人可以告诉我为什么它不适用于我的主要项目吗?
提前致谢
I am trying to send push notifications to myself.
I have copied the code from Apple. But I am getting the error no valid 'aps-environment' entitlement string found for application.
I made a new project with the same code (without adding entitlements.plist)and it's working fine.
so it's not the problem of my provisioning profile or my code, then what is?
Can someone tell me why it isn't working on my main project?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这意味着用于构建应用程序的配置文件未启用推送通知。必须在 iTunes 开发者门户中为该应用程序 ID 启用推送通知。
如果您已启用推送通知但仍然收到此错误,可能是因为您在创建配置文件后启用了推送通知。在这种情况下,配置文件将不具有所需的推送通知设置,必须重新生成。
要重新生成配置文件,请在 iTunes 开发者门户中找到它,然后单击“编辑”->“修改”并保存。当您下载新的配置文件时,我们建议您先从设备和 XCode 中删除现有的配置文件,然后再安装新的配置文件。许多开发人员继续报告问题,除非他们执行此步骤。
This means that the provisioning profile used to build the application does not have push notifications enabled. Push notifications must be enabled for that application ID in the iTunes Developer Portal.
If you’ve already enabled push notifications and still receive this error, it might be because you enabled push notifications after the provisioning profile was created. In this case, the profile will not have the required push notification settings, and must be regenerated.
To regenerate the provisioning profile, find it in the iTunes Developer Portal, and click Edit->Modify and save it. When you download the new profile, we recommend removing the existing profile from the device and XCode before installing the new one. Many developers continue to report problems unless they do this step.