ios – APN生产证书不被PushSharp认可

前端之家收集整理的这篇文章主要介绍了ios – APN生产证书不被PushSharp认可前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我开发了一个接受推送通知的iOS应用程序.我使用PushSharp从.NET环境发送它们.一切都在发展中精美,Pushs成功发送:
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!

证书既不是发展也不是生产?

有什么地方可以验证文件吗?请给我一些关于这件事情的疑虑,因为我不知道从哪里开始

@H_301_23@解决方法
苹果已经改名了.请转到ApplePushChannelSettings.cs并更改名称如下.

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

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

我昨天更新我过期的证书时需要这样做.更改名称,重建并上传到服务器,然后再次运行.

原文链接:https://www.f2er.com/iOS/336277.html

猜你在找的iOS相关文章