简体   繁体   English

如何将证书从开发转换为生产?

[英]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: 棘手的部分是:

  1. if you only have a device token you will not know if it is a production device token or a sandbox device token. 如果只有设备令牌,则不会知道它是生产设备令牌还是沙盒设备令牌。
  2. if you want to use release and debug clients against the same server, that server has to use the sandbox and the production service at the same time. 如果要针对同一服务器使用发布和调试客户端,则该服务器必须同时使用沙箱和生产服务。 And you need a mechanism to decide when to use which service. 您需要一种机制来决定何时使用哪种服务。

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.

相关问题 CloudKit:将容器环境从开发切换到生产 - CloudKit: switch container environment from Development to Production 我是否需要同时创建开发和生产SSL证书Xamarin.iOS - Do I need to create both Development and Production SSL Certificate Xamarin.iOS 如何在iOS开发中切换新的视图控制器? - How do I switch a new view controller in iOS development? 通用证书适用于生产,但不适用于开发 - Universal certificate works for production but not development 提交带有Apple开发证书的应用程序以获取推送通知或生产证书? - Submit app with a Apple Development Certificate for Push notifications or Production Certificate? 当我切换到生产证书时,Trigger.io和解析推送通知不起作用 - Trigger.io & Parse push notifications don't work when I switch to production certificate 每个应用程序都需要单独的发行证书和开发证书吗? - Do I need sepearate distribution certificate and development certificate for each of my app? 出于开发目的,如何使用 iOS 7 的 NSURLSession 及其委托方法系列接受自签名 SSL 证书? - How do I accept a self-signed SSL certificate using iOS 7's NSURLSession and its family of delegate methods for development purposes? 如何在发行版本中使用APS开发证书? - How can I use APS development certificate in a release build? 如何从 App Delegate 切换到不同的视图 controller? - How do I switch to a different view controller from the App Delegate?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM