Don't receive Push Notification iPhone

294 Views Asked by At

I use two simle example for sending push notifications on iPhone.

First example. I use PushSharp for sending:

var push = new PushBroker();
var appleCert = File.ReadAllBytes(@"C:\pushService.p12");
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "xxxxxxxxxx"));
push.QueueNotification(new AppleNotification()
    .ForDeviceToken("3b04d81f071e4ce729a0490bf9c730a1c10bf723f2308490ffb1a9b2d721975d")
    .WithAlert("Hello World!")
    .WithBadge(7)
    .WithSound("sound.caf"));

Second example. I use MoonAPNS

var payload = new NotificationPayload("3b04d81f071e4ce729a0490bf9c730a1c10bf723f2308490ffb1a9b2d721975d",
                    "Hello world", 0, "sound.caf");
var notificationList = new List<NotificationPayload> {payload};
var pushh = new PushNotification(true, @"C:\pushService.p12", "xxxxxxxxxx");
var result = pushh.SendToApple(notificationList);

Can somebody explain me why it dont work?

0

There are 0 best solutions below