gpt4 book ai didi

ios - 来自 WebApi 应用程序的 Apple 推送通知

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:42:01 26 4
gpt4 key购买 nike

我正在使用 PushSharp对于 Apple Push Notifications,它在 Windows 8 和 Windows Server 2008R2 上通过控制台应用程序和 Windows 服务工作,但传输到同一台计算机上的 WebApi 应用程序的相同代码不起作用。我已经通过 mmc 在个人中安装了证书和私钥(私钥可用,已授予 IIS_USRS 的权限)和受信任的根证书颁发机构。代码有点明显,但以防万一:

var push = PushBroker();
var appleCert = File.ReadAllBytes("C:\Users\Documents\Certificates\Push.p12");
push.RegisterAppleService(new PushSharp.Apple.ApplePushChannelSettings(false, appleCert, "pwd"));
PushSharp.Apple.AppleNotification notif = new PushSharp.Apple.AppleNotification()
.ForDeviceToken("xxx")
.WithAlert("Updated...")
.WithBadge(1)
.WithSound("default");
push.QueueNotification(notif);
//Wait for queue to finish
push.StopAllServices(true);

没有错误/异常等,只是 iPhone 设备在 WebApi 应用程序中启动时没有收到通知。

最佳答案

您是否检查了所有事件句柄是否有错误? PushBroker 实例上有很多错误,您可以在其中订阅以拦截错误(如果有的话)。

订阅:OnServiceExceptionOnNotificationFailed

检查 IIS|app|users|roles 是否具有访问 web 的所有权限。

关于ios - 来自 WebApi 应用程序的 Apple 推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26432992/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com