我正在尝试使用Firebase API发送通知,如果通知JSON对象中只有“标题”和“正文”,则通知会成功发送。 但是,如果我根据文档的描述将“sound”:“default”添加到通知对象中,则会出现以下错误:
“无效的JSON有效负载。在'message.notification'处找不到字段位置为“sound”的未知名称。”
我的JSON对象如下所示:
{"message":{"token": token, "notification":{"title":"Test", "body":"Test message from server", "sound":"default"}}}