作者coolqwe789 (嘎嘎)
看板C_Sharp
標題[程式] pushsharp ios無法傳送訊息
時間Thu Jul 9 20:51:47 2015
不好意思想請問一下關於pashsharp的相關問題
iOS手機端都無法收到Server端送出的訊息
以下是我的程式碼
{
var push = new PushBroker();
var appleCert = System.IO.File.ReadAllBytes(Server.MapPath("~/bin/External/poshsharptest_production.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(true, appleCert, "password"));
push.QueueNotification(
new PushSharp.Apple.AppleNotification()
.ForDeviceToken(registrationid)
.WithAlert("Hello World!")
.WithSound("default")
);
}
是iOS憑證上的問題還是說C#程式碼有問題
煩請各位幫小弟解答了謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.121.135.70
※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1436446310.A.D0E.html
→ sos0214: 自行用openssl看一下p12有沒有過期 07/10 16:57
→ ssccg: 有問題的話server就會直接回你error 07/10 16:58
→ ssccg: 看一下pushsharp有沒有取error message的API 07/10 16:59
→ coolqwe789: 感謝以解決憑證的部份有測試跟產品這部份沒看清楚 07/14 01:06