简体   繁体   中英

C# PushSharp notification for IOS is not working in IIS 7.5

         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);

I did changes settings in IIS DefaultAppPool> Advanced settings >identity is changed to LocalSystem. still its not working.

http://blog.mdisoft.com/post/10736697438/apple-push-notifications-apns-with-net-c-and

Please do somebody help regarding the same

Thank You

After R&D I got solution to this

I used following project to run IOS pushnotification

sometimes it wont work in IIS6 but its working correctly in IIS7.5

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM