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!

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

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

解决方法

苹果已经改名了.请转到ApplePushChannelSettings.cs并更改名称如下.

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

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

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

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...