PushBroker push = new PushBroker();
var appleCert = File.ReadAllBytes(@"D:\Mvc\pushNotification\pushNotification\Key\file.p12");
push.OnNotificationSent += NotificationSent;
push.OnChannelException += ChannelException;
push.OnServiceException += ServiceException;
push.OnNotificationFailed += NotificationFailed;
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
push.OnChannelCreated += ChannelCreated;
push.OnChannelDestroyed += ChannelDestroyed;
push.RegisterAppleService(new PushSharp.Apple.ApplePushChannelSettings(false, appleCert, "password"));
PushSharp.Apple.AppleNotification notif = new PushSharp.Apple.AppleNotification()
.ForDeviceToken("deviceToken")
.WithAlert("Message")
.WithBadge(1)
.WithSound("default");
push.QueueNotification(notif);
push.StopAllServices(waitForQueuesToFinish: true);
我在IIS DefaultAppPool中执行了更改设置>高级设置>标识已更改为LocalSystem。仍然无法正常工作。
http://blog.mdisoft.com/post/10736697438/apple-push-notifications-apns-with-net-c-and
请为同一个人提供帮助
谢谢
答案 0 :(得分:1)
在R& D之后我得到了解决方案
我使用以下项目来运行IOS推送
有时它在IIS6中不起作用,但它在IIS7.5中正常工作
https://github.com/Redth/APNS-Sharp/tree/master/JdSoft.Apple.Apns.Notifications