使用推送清晰库

时间:2016-07-27 14:09:25

标签: c# ios .net apple-push-notifications

我在发送iOS设备的推送通知时收到以下错误。这几天工作正常,但突然停止工作我试图在我的本地机器上安装证书,但没有运气。我正在使用2.2.1版本的pushsharp。我试图谷歌这个错误,但没有一个解决方案适合我。有人可以帮忙吗?

使用代码:

string cert = appSettings.Where(x => x.Key == "APNS_CUSTOMER_CERT").Select(x => x.Value).FirstOrDefault();

var appleCert = System.Web.Hosting.HostingEnvironment.MapPath("~/Certificate") + "\\" + cert;

push.RegisterAppleService(new ApplePushChannelSettings(true, appleCert, "", true));

AppleNotificationAlert alert = new AppleNotificationAlert();
alert.Body = TickerText;

AppleNotificationPayload p = new AppleNotificationPayload();
p.AddCustom("Msg", BodyText);
p.Badge = 1;

p.Alert = alert;

foreach (var s in additionalData)
{
    p.AddCustom(s.Key, s.Value);
}

push.QueueNotification(new AppleNotification()
                            .ForDeviceToken(DeviceToken)//the recipient device id
                            .WithPayload(p)
                            );
  

频道例外: PushSharp.Apple.ApplePushService - > System.Security.Authentication.AuthenticationException:对SSPI的调用   失败了,看内部异常。 --->   System.ComponentModel.Win32Exception:发生未知错误   处理证书---内部异常堆栈跟踪结束   ---在System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken   消息,AsyncProtocolRequest asyncRequest,异常异常)at   System.Net.Security.SslState.ProcessReceivedBlob(Byte []缓冲区,Int32   count,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,   AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ProcessReceivedBlob(Byte []缓冲区,Int32   count,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,   AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ProcessReceivedBlob(Byte []缓冲区,Int32   count,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,   AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ProcessReceivedBlob(Byte []缓冲区,Int32   count,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,   AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ProcessReceivedBlob(Byte []缓冲区,Int32   count,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,   AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst,   Byte [] buffer,AsyncProtocolRequest asyncRequest)at   System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult   lazyResult)at   PushSharp.Apple.FeedbackService.Run(ApplePushChannelSettings设置,   取消语音cancelToken)at   PushSharp.Apple.ApplePushService.c__AnonStorey0<> m__1(对象   状态)

     

2016-07-27 19:28:14,681 [136] INFO WebAPI - 失败:   PushSharp.Apple.ApplePushService - >发送的最大数量   尝试发送通知!

0 个答案:

没有答案