我开发了一个接受推送通知的iOS应用程序.我使用PushSharp从.NET环境发送它们.一切都在发展中精美,Pushs成功发送:
@H_301_23@解决方法
var push = new PushBroker(); var appleCert = File.ReadAllBytes(@"Utils\Cert.Development.p12"); push.RegisterAppleService(new ApplePushChannelSettings(false,appleCert,"*******")); push.QueueNotification(new AppleNotification() .ForDeviceToken(token) .WithContentAvailable(1) ); push.StopAllServices();
现在,该应用已被批准,它在AppStore.我已经生成正确的生产证书:
var push = new PushBroker(); var appleCert = File.ReadAllBytes(@"Utils\Cert.Production.p12"); push.RegisterAppleService(new ApplePushChannelSettings(true,"*******")); push.QueueNotification(new AppleNotification() .ForDeviceToken(token) .WithContentAvailable(1) ); push.StopAllServices();
但是当我尝试从PushSharp发送push时,会引发以下异常:
You have selected the Production server,yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!
我确信我已经遵循了所有的步骤.我已经下载了与应用程序中设置的配置文件绑定的生产证书以进行发布.打开它并导出.p12.
我也确定我不是偶然使用开发,因为如果我设置PushSharp进行开发,使用最后一个证书,它会引发以下错误:
You have selected the Development/SandBox (Not production) server,yet your Certificate does not appear to be the Development/SandBox (Not production) certificate! Please check to ensure you have the correct certificate!
证书既不是发展也不是生产?
有什么地方可以验证文件吗?请给我一些关于这件事情的疑虑,因为我不知道从哪里开始