配置文件 +推送通知 +生产与开发
我正在构建一个使用推送通知的 iOS 应用程序,我终于准备好提交它了。在此之前,我想测试生产服务器上的推送通知,以确保一切正常工作。到目前为止,沙箱环境运行良好。
经过大量搜索后,我了解到将服务器从 ssl://gateway.sandbox.push.apple.com:2195 切换到 ssl://gateway.push。 apple.com:2195 还不够,而且生产推送代币与沙箱推送代币不同。相反,显然我需要一个具有生产权利的新配置文件,在我的服务器上安装新证书,并使用所述配置文件重新构建我的应用程序,以便它知道创建正确的推送令牌。
因此,在完成所有步骤后,我什至无法在手机上运行构建; XCode 说
此配置文件无法安装在设备上
以下是我已采取的步骤。如果我遗漏了某些内容,请告诉我:
在我的 iOS 开发人员中心,我已确保我的 AppID 在 Apple 推送通知服务下“已启用生产”。
还在我的 iOS 开发人员中心中,我创建了生产推送 SSL 证书,完成了必要的转换步骤,并将生成的 .pem 安装在我的服务器上。
按照说明,我创建了“一个新的配置文件,其中包含您希望用于通知的应用程序 ID”。我通过转到“配置”,单击“分发”选项卡并创建一个新配置文件来完成此操作。我已确认此配置文件的“权利”部分下设置了“生产”。
我已在项目设置中选择了配置配置文件。我收到消息了
<块引用>此配置文件无法安装在设备上
我陷入了困境。
I'm building an iOS app that uses push notifications, and I'm finally ready to submit it. Before I do, I'd like to test out push notifications off the Production server, to make sure everything is working correctly. Thus far, the sandbox environment has been working fine.
After doing quite a bit of searching, I learned that switching the servers over from ssl://gateway.sandbox.push.apple.com:2195
to ssl://gateway.push.apple.com:2195
wasn't enough, and that production push tokens are different from sandbox push tokens. Instead, apparently I need a new provisioning profile with Production entitlements, new certs installed on my server, and to re-build my app with said profile so that it knows to create the correct push tokens.
So, after going through all the steps, I can't even make a build run on my phone; XCode says
This profile cannot be installed on devices
Here are the steps I've taken. If I'm missing something please let me know:
In my iOS Developer Center, I've made sure that my AppID is "enabled for production" under the Apple Push Notification Service.
Also in my iOS Developer Center, I've created my Production Push SSL Certificate, gone through the necessary conversion steps, and installed the resulting .pem on my server.
Per the instructions, I've create "a new provisioning profile containing the App ID you wish to use for notifications." I've done this by going to Provisioning, and clicking on the "Distribution" tab, and making a new profile. I've confirmed that "production" is set under the "entitlements" section of this profile.
I've selected the provisioning profile in my project settings. I get the message
This profile cannot be installed on devices
and I'm stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
构建应用程序的临时分发版本,并将其安装在您自己的设备上。这将使用生产 APN 网关和证书。
Build an ad-hoc distribution version of your app, and install it on your own device. That will use the production APN gateway and certs.
您无法在设备上安装使用应用程序商店分发(生产)配置文件编译的应用程序。只有苹果评审员才能做到这一点。您只能在开发模式下编译并使用沙箱服务器的应用程序上测试推送。
如果要测试生产服务器,则必须使用 AdHoc 分发配置文件来编译应用程序,以启用要进行测试的设备。显然,您必须使用 App Store 分发配置文件重新编译并发送应用程序以供审核。
You cannot install an app compiled with a appstore distribution (production) profile on a device. Only Apple reviewers can do that. you can only test push on an app compiled in development mode and using sandbox server.
If you want to test production servers, you must compile the app using an AdHoc distribution profile enabling the devices you want to do the test. Clearly you must recompile and the send the app for review using the App Store distribution profile.