iPhone でプッシュ通知を送信するための 2 つの簡単な例を使用します。
最初の例。送信には PushSharp を使用します。
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"));
2番目の例。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);
誰かがなぜそれがうまくいかないのか説明できますか?