5

在 windows phone 8 中调用 voip 代理,服务器需要通过 MPNS 发送类型 4 原始通知,并带有以下负载。

HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri);

sendNotificationRequest.Method = "POST";

// We will create a HTTPWebRequest that posts the raw notification to the Microsoft Push Notification Service.
// HTTP POST is the only allowed method to send the notification.

// Create the raw message.

string rawMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<root></root>";
// Sets the notification payload to send.
byte[] notificationMessage = Encoding.Default.GetBytes(rawMessage);

// Sets the web request content length.
sendNotificationRequest.ContentLength = notificationMessage.Length;
sendNotificationRequest.ContentType = "text/xml";
sendNotificationRequest.Headers.Add("X-NotificationClass", "4");


using (Stream requestStream = sendNotificationRequest.GetRequestStream())
{
    requestStream.Write(notificationMessage, 0, notificationMessage.Length);
}

使用 WNS 作为通知服务启动 voip 代理的推送负载是什么?

4

0 回答 0