Apple 푸시 알림에 PushSharp을 사용하고 있으며 Windows 8 및 Windows Server 2008 R2의 콘솔 앱 및 Windows 서비스에서 작동하지만 동일한 컴퓨터의 WebApi 앱으로 전송 된 동일한 코드가 작동하지 않습니다 . Personal에 mmc를 통해 인증서 및 개인 키를 설치했습니다 (개인 키를 사용할 수 있고 IIS_USRS에 대한 사용 권한이 부여됨) 및 신뢰할 수있는 루트 인증 기관. 코드,하지만 단지의 경우 가지 분명하다 : WebApi 응용 프로그램의 시작 때WebApi 앱의 Apple Push 알림
var push = PushBroker();
var appleCert = File.ReadAllBytes("C:\Users\Documents\Certificates\Push.p12");
push.RegisterAppleService(new PushSharp.Apple.ApplePushChannelSettings(false, appleCert, "pwd"));
PushSharp.Apple.AppleNotification notif = new PushSharp.Apple.AppleNotification()
.ForDeviceToken("xxx")
.WithAlert("Updated...")
.WithBadge(1)
.WithSound("default");
push.QueueNotification(notif);
//Wait for queue to finish
push.StopAllServices(true);
에러/예외 등의 단지 아이폰 장치는 알림을하지 않습니다.
[http://stackoverflow.com/questions/23115394/pushsharp-apple-the-message-received-was-unexpected-or-badly-formatted]에는 답변이 포함되어 있습니다. PushSharp를 2.2.1로 업데이트 한 후 문제가 해결되었습니다. –
좋아, 좋은 소식! 며칠 내로 서버와 클라이언트에서 완전한 PushSharp 데모 구현을 사용하여 git repo를 게시 할 예정입니다. 나중에 여기에서 확인할 수 있도록 게시 할 것입니다. –