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

请就此做些帮助

谢谢

最佳答案

经过研发,我得到了解决方案

我使用以下项目来运行IOS pushnotification

有时它无法在IIS6中工作,但可以在IIS7.5中正常工作

https://github.com/Redth/APNS-Sharp/tree/master/JdSoft.Apple.Apns.Notifications

关于c# - IOS的C#PushSharp通知在IIS 7.5中不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29071294/

10-12 14:18