我正尝试使用生产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的例子吗? –