[英]How do I switch the certificate from development to production?
I am trying to testflight my app, but when I use notifications I get an error because I have a development APN instead of a production APN. 我正在尝试测试我的应用程序,但是使用通知时出现错误,因为我有一个开发APN而不是生产APN。 My problem is uploading it to parse.
我的问题是将其上传以进行解析。 First I created a development SSL Certificate, then I went back and did a Production SSL Certificate, but I am having trouble uploading the Production Certificate because It's not an APN, rather a Apple Push Services.
首先,我创建了一个开发SSL证书,然后返回并进行了生产SSL证书,但是由于它不是APN,而是Apple Push Services,因此无法上传生产证书。 I also created a Distribution Provisioning (ad hoc).
我还创建了分发配置(临时)。
Apples Push Notification service is a bit strange: 苹果推送通知服务有点奇怪:
On the client side: If you build your client with Xcode you usually build a "Debug" version of your app. 在客户端:如果您使用Xcode构建客户端,则通常会构建应用程序的“调试”版本。 In that case the registerForRemoteNotification method will create a sandbox device token for you.
在这种情况下,registerForRemoteNotification方法将为您创建一个沙箱设备令牌。
If you build a "Release" version of your app the same method create a production device token for you. 如果您构建应用程序的“发布”版本,则使用相同的方法为您创建生产设备令牌。
On the server side: If you have a sandbox device token you can only send a push notification to that device if you use Apples sandbox Push Notification service with your sandbox SSL certificate. 在服务器端:如果您具有沙箱设备令牌,则只有在将Apples沙箱“推送通知”服务与沙箱SSL证书一起使用时,您才能向该设备发送推送通知。
If you have a production device token then you have to use Apples production push notification service with your production SSL certificate to send a push notification to that device. 如果您具有生产设备令牌,则必须将Apples生产推送通知服务与生产SSL证书一起使用,以将推送通知发送到该设备。
The tricky part is: 棘手的部分是:
BTW: there is a nice tutorial by Ray Wenderlich which also contains a useful PHP script for easy testing. 顺便说一句:Ray Wenderlich提供了一个不错的教程,其中还包含一个易于测试的有用PHP脚本。 http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.