C# Azure WindowsPushMessage Xml有效负载格式
在我的Azure移动服务上,我正在使用以下代码向Windows Phone 8.1发送推送通知:C# Azure WindowsPushMessage Xml有效负载格式,c#,push-notification,windows-phone-8.1,azure-mobile-services,C#,Push Notification,Windows Phone 8.1,Azure Mobile Services,在我的Azure移动服务上,我正在使用以下代码向Windows Phone 8.1发送推送通知: WindowsPushMessage message = new WindowsPushMessage(); message.XmlPayload = @"<?xml version=""1.0"" encoding=""utf-8""?>" + @"<toast><visual><binding template=""ToastText01""&g
WindowsPushMessage message = new WindowsPushMessage();
message.XmlPayload = @"<?xml version=""1.0"" encoding=""utf-8""?>" +
@"<toast><visual><binding template=""ToastText01"">" +
@"<text id=""1"">" + pushString + @"</text>" +
@"</binding></visual></toast>";
try
{
var result = await Services.Push.SendAsync(message);
Services.Log.Info(pushString);
}
catch (System.Exception ex)
{
Services.Log.Error(ex.Message, null, "Push.SendAsync Error");
}
有人能告诉我正确的格式是什么吗?如下所示:
message.XmlPayload = @"<?xml version=""1.0"" encoding=""utf-8""?>" +
@"<toast><visual><binding template=""ToastNewPayload"">" +
@"<text id=""1"">" + TextBoxTitle.Text.ToString()+ @"</text>" +
@"<text id=""2"">" + TextBoxSubTitle.Text.ToString() + @"</text>" +
@"<text id=""3"">/Page2.xaml?NavigatedFrom=Toast Notification</text>" +
@"</binding></visual></toast>";
message.XmlPayload=@“”+
@"" +
@“”+TextBoxTitle.Text.ToString()++”+
@“+TextBoxSubTitle.Text.ToString()+@”+
@“/Page2.xaml?NavigatedFrom=Toast通知”+
@"";
请参阅以下文档:手机应用程序可以接收此格式,但它不显示任何文本,也不允许我导航到该页面。它只是说新的通知。。。
The payload is not in accepted XML format. The first node should be Badge/Tile/Toast. If want to send raw notification, please set header to wns/raw.
message.XmlPayload = @"<?xml version=""1.0"" encoding=""utf-8""?>" +
@"<toast><visual><binding template=""ToastNewPayload"">" +
@"<text id=""1"">" + TextBoxTitle.Text.ToString()+ @"</text>" +
@"<text id=""2"">" + TextBoxSubTitle.Text.ToString() + @"</text>" +
@"<text id=""3"">/Page2.xaml?NavigatedFrom=Toast Notification</text>" +
@"</binding></visual></toast>";