Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.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
Xamarin Azure通知中心iOS模板不再接受徽章字段?_Xamarin_Azure Notificationhub - Fatal编程技术网

Xamarin Azure通知中心iOS模板不再接受徽章字段?

Xamarin Azure通知中心iOS模板不再接受徽章字段?,xamarin,azure-notificationhub,Xamarin,Azure Notificationhub,我们正在使用Xamarin的Azure消息组件注册模板推送通知。 到目前为止,我们已使用以下模板注册到通知: @"{""aps"": {""alert"": ""$(message)"",""badge"": ""$(badge)"",""sound"": ""$(sound)""}}" 我们正在将此字符串传递到iOS应用程序中的Hub.RegisterTemplateAsync 一段时间以前(不到一个月),调用RegisterTemplateAsync将生成以下响应: Apr 3 13:3

我们正在使用Xamarin的Azure消息组件注册模板推送通知。 到目前为止,我们已使用以下模板注册到通知:

@"{""aps"": {""alert"": ""$(message)"",""badge"": ""$(badge)"",""sound"": ""$(sound)""}}"
我们正在将此字符串传递到iOS应用程序中的
Hub.RegisterTemplateAsync

一段时间以前(不到一个月),调用RegisterTemplateAsync将生成以下响应:

Apr  3 13:35:03 iPhone MyApp[352] <Warning>: Error Response:<Error><Code>400</Code><Detail>The supplied notification payload is invalid.TrackingId:5dbf4199-cf52-4245-b8e4-acfa4e00cfee_G7,TimeStamp:4/3/2016 10:35:04 AM</Detail></Error>
Apr  3 13:35:03 iPhone MyApp[352] <Warning>: -------------> Notifications: RegisterTemplateAsync error: Fail to perform registration operation. Response:<Error><Code>400</Code><Detail>The supplied notification payload is invalid.TrackingId:5dbf4199-cf52-4245-b8e4-acfa4e00cfee_G7,TimeStamp:4/3/2016 10:35:04 AM</Detail></Error>
它与以前工作的二进制文件完全相同。现在没有了

对问题进行故障排除时,我们发现问题出在
badge
字段。当我们删除它时,向通知中心的注册将成功:

@"{""aps"": {""alert"": ""$(message)"",""sound"": ""$(sound)""}}";
因此,现在我们在AppStore中有一个坏掉的生产应用程序,无法再获取通知


这是集线器端发生的变化还是我们有可能做错了什么?

您是否尝试使用“#(badge)””而不是“$(badge)”?

您是否有向通知集线器发送通知消息的示例?您确定要以数字而不是字符串的形式发送徽章值吗?因为在我看来一切都是正确的。我得到的错误是在注册客户的过程中。不是在发送通知时,而是在调用
Hub.RegisterTemplateAsync
时,我还会尝试:@“{'aps':{'alert':'$(message)”,'badge':#(badge),'sound':$(sound)}}”
#(badge)
有效。谢谢您知道这是否有文档记录(在RESTAPI文档或任何教程中都没有看到任何内容)?