c# - 使用 .pem 证书注册 Apple 服务

标签 c# ios push-notification pem pushsharp

我想向 iOS 设备发送测试 PUSH 消息。我获得了设备 token 和一个 .pem 文件作为证书。但我似乎找不到使用此 .pem 文件创建新 ApplePushChannelSettings 对象的方法。网上的例子都是用.p12文件,里面有密码。

//Create our push services broker
var push = new PushBroker();

//Registering the Apple Service and sending an iOS Notification
var appleCert = File.ReadAllBytes("ApnsSandboxCert.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "pwd"));
push.QueueNotification(new AppleNotification()
                           .ForDeviceToken("DEVICE TOKEN HERE")
                           .WithAlert("Hello World!")
                           .WithBadge(7)
                           .WithSound("sound.caf"));

我应该为目标应用程序请求一个.p12 证书,还是有办法将.pem 文件与PushSharp 一起使用?

最佳答案

根据我的经验,所有推送通知服务都需要一个.p12 证书。你应该试试看。

编辑:
经过quick search ,我认为你别无选择。 .p12 是。

关于c# - 使用 .pem 证书注册 Apple 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30592107/

相关文章:

c# - iOS 和 .NET 之间的 Rijndael 加密

c# - 奇怪的跨线程 UI 错误

c# - 安全导航表达式重写器

ios - 使用 swift 从中删除项目后,CollectionView indexPath 不更新

javascript - 如何从 javascript 或 c# 向 android - IOS 和 WinPhone 发送推送通知

ios - Swift:应用程序运行时如何存储推送通知?

c# - 在类里面获取路线数据

ios - 如何保存从一个 ViewController 到另一个 ViewController 的数据?

ios - 显示数组值的每周本地通知 - Swift

Android GCM 通知返回堆栈