我正嘗試使用生產APN服務器將MDM推送通知發送到iPad。然而,夏普推說,通知失敗,因爲標識符等於1.從PushSharp代碼庫下面的代碼說明它是如何來到這個結論...無法使用Push Sharp發送iOS MDM推送通知
//We now expect apple to close the connection on us anyway, so let's try and close things
// up here as well to get a head start
//Hopefully this way we have less messages written to the stream that we have to requeue
try { stream.Close(); stream.Dispose(); }
catch { }
//Get the enhanced format response
// byte 0 is always '1', byte 1 is the status, bytes 2,3,4,5 are the identifier of the notification
var identifier = IPAddress.NetworkToHostOrder(BitConverter.ToInt32(readBuffer, 2));
int failedNotificationIndex = -1;
SentNotification failedNotification = null;
//Try and find the failed notification in our sent list
for (int i = 0; i < sentNotifications.Count; i++)
{
var n = sentNotifications[i];
if (n.Identifier.Equals(identifier))
{
failedNotificationIndex = i;
failedNotification = n;
break;
}
}
基本上,後寫的有效載荷該流嘗試關閉連接,在此期間,它期望來自APN服務的響應,我認爲它將其稱爲通知標識符。
我已將設備插入iPhone設備配置實用程序,但沒有任何內容出現在控制檯中,因此我認爲它從未收到此通知。
我的問題是...
- 這是什麼標識符,它期待?
- 有什麼我做錯了嗎?是
該設備運行iOS 6.有效負載的結構如下...
{"aps":{},"mdm":"80369651-5802-40A2-A0AE-FCCF02F99589"}
在[]中的6個字節返回的字節的值如下8,8,0,0,0,1
你能提供一個PushSharp 4.0的例子嗎? –