【问题标题】:C# PushSharp notification for IOS is not working in IIS 7.5IOS 的 C# PushSharp 通知在 IIS 7.5 中不起作用
【发布时间】:2015-03-16 07:07:39
【问题描述】:
         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

请人帮忙解决一下

谢谢

【问题讨论】:

  • 您是否使用了正确的证书。您应该有 2 个证书,一个用于沙盒通知,一个用于生产通知。
  • 是的,我正在使用沙盒证书,它在 IIS6 中完美运行,但问题出在 IIS7.5 中
  • 您是否收到任何错误/异常?
  • 不,我没有收到任何异常 n 手机没有收到推送通知 n 相同的代码在 iis6 服务器中工作正常

标签: c# ios pushsharp


【解决方案1】:

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

我使用以下项目来运行 IOS 推送通知

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多