Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure WindowsPushMessage Xml有效负载格式_C#_Push Notification_Windows Phone 8.1_Azure Mobile Services - Fatal编程技术网

C# Azure WindowsPushMessage Xml有效负载格式

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

在我的Azure移动服务上,我正在使用以下代码向Windows Phone 8.1发送推送通知:

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>";