Azure Notification Hub iOS模板不再接受徽章字段了?

dar*_*ala 2 xamarin azure-notificationhub

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

@"{""aps"": {""alert"": ""$(message)"",""badge"": ""$(badge)"",""sound"": ""$(sound)""}}"
Run Code Online (Sandbox Code Playgroud)

我们将此字符串传递给Hub.RegisterTemplateAsynciOS应用程序.

从一段时间以前(不到一个月),调用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>
Run Code Online (Sandbox Code Playgroud)

它与以前的二进制文件完全相同.现在它没有.

在解决问题时,我们发现问题在于该badge字段.当我们删除它时,注册到通知中心成功:

@"{""aps"": {""alert"": ""$(message)"",""sound"": ""$(sound)""}}";
Run Code Online (Sandbox Code Playgroud)

所以现在我们在AppStore中有一个破碎的生产应用程序,无法再收到通知.

这是在集线器方面发生了变化,还是有可能我们做错了什么?

小智 6

您是否尝试使用""#(徽章)""而不是""$(徽章)""?