APN产品证书不被认可PushSharp [英] APN Production certificate not being recognized by PushSharp

查看:1256
本文介绍了APN产品证书不被认可PushSharp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发iOS应用程序,接收推送通知。我是从一个.NET环境中使用PushSharp送他们。一切都很精美,同时开发和推手已成功发送:

I've developed an iOS app, that receives Push Notifications. I'm sending them from a .NET environment using PushSharp. Everything went beautifully while developing, and the Pushs were successfully sent:

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的。我有产生正确的生产许可证:

Now, the app has been approved, and it's at AppStore. I have generate the correct production certificate:

var push = new PushBroker();
var appleCert = File.ReadAllBytes(@"Utils\Cert.Production.p12");
push.RegisterAppleService(new ApplePushChannelSettings(true, appleCert, "*******"));
push.QueueNotification(new AppleNotification()
    .ForDeviceToken(token)
    .WithContentAvailable(1)
);
push.StopAllServices();

但是当我尝试发送从PushSharp推,它抛出以下异常:

but when I try to send the push from PushSharp, it throws the following exception:

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!

我是pretty肯定我已经照着所有的步骤。我已经下载了与在应用程序发布设置配置文件绑定的生产许可证。打开它,并出口中.P12。

I'm pretty sure I've followed all the steps. I've downloaded the production certificate that was binded with the provisioning file set in the app to publish. Opened it and exported the .p12.

我也确信我不是用开发的一款意外,因为,如果我设置PushSharp发展,利用这最后的证书,它引发以下错误:

I'm also sure I'm not using a development one by accident, because, if I set PushSharp for development, using this last certificate, it throws the following error:

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!

如何可以将证书既不开发,也不是生产?

有没有什么地方我可以验证文件?请给我一些insigth在这个问题上,因为我不知道从哪里开始。

Is there somewhere I can validate the file? Please give me some insigth on this matter, as I have no clue where to start

推荐答案

苹果已经改变了名称。请到ApplePushChannelSettings.cs并更改名称如下图所示。

Apple has changed the name. Please go to ApplePushChannelSettings.cs and change the name as below.

if (production && !subjectName.Contains("Apple Production IOS Push Services"))

if (production && !subjectName.Contains("Apple Push Services"))

我要做到这一点,当我更新我的证书过期昨天。更改名称,重建它并上传到服务器,那么它的再次合作。

I need to do this when I renewing my expired cert yesterday. Change the name, rebuild it and upload to server, then it's working again.

这篇关于APN产品证书不被认可PushSharp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆