2013-07-14 111 views
1

我遇到同樣的問題。我不是一名IOS開發人員,但我是一名c#開發人員。 iOS開發人員向我提供配置文件,以便在運行的Windows服務中發送推送通知。我用我的iPad測試了PushSharp,但沒有奏效。我收到錯誤消息:發送IOS推送通知的PushSharp錯誤消息

推送通知失敗:PushSharp.Core.MaxSendAttemptsReachedException:達到發送通知的最大嘗試次數!

我已經嘗試過本地和服務器上,我只是試圖發送1推。

代碼。

var appleCertificate = 
File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sb_push.p12")); 
var push = new PushBroker(); 
/* push.OnNotificationSent += NotificationSent; 
push.OnChannelException += ChannelException; 
push.OnServiceException += ServiceException; 
push.OnNotificationFailed += NotificationFailed; 
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired; 
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged; 
push.OnChannelCreated += ChannelCreated; 
push.OnChannelDestroyed += ChannelDestroyed; 
push.OnNotificationSent += NotificationSent;*/ 
push.OnNotificationFailed += NotificationFailed; 
push.RegisterAppleService(new ApplePushChannelSettings(appleCertificate, "PASSWORD!")); 
push.QueueNotification(new AppleNotification() 
.ForDeviceToken(deviceToken) 
.WithAlert(message) 
.WithSound("default")); 

回答