OGeek|极客世界-中国程序员成长平台

标题: ios - Azure 通知中心 : APNS dictionary not being sent. [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 12:48
标题: ios - Azure 通知中心 : APNS dictionary not being sent.

我对 Azure 通知中心比较陌生。当我发送一个像这样形成的 JSON 对象时,我的系统正在工作。

{"aps": {"alert" : "hello"}}

但是当我像下面这样发送有效负载时,Azure 在其调试控制台中显示成功,但它从未到达我的移动设备。

{"aps": {"alert" : {"msg":"hello"}}}

区别显然是字符串与对象。 APNS documentation表明我应该能够发送字符串或字典。

还有其他人看到过这种行为吗?无论如何要修复它?我真的希望能够发送一个对象,而不是必须在客户端解析字符串。



Best Answer-推荐答案


找到我自己的答案。我很愚蠢,没有更仔细地阅读文档。问题是字典需要某些键。以下有效载荷将起作用。

{"aps": {"alert" : {"body":"hello"}}}

enter image description here

我错过了字典需要某些键。文档指定了 body、action-loc-key、loc-key、loc-args、launch-image。这是文档的屏幕截图。

enter image description here

关于ios - Azure 通知中心 : APNS dictionary not being sent.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26978892/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4