推送通知失败 [英] Push notif failed with curl

查看:62
本文介绍了推送通知失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试用于Android开发的推送通知,目前正在使用Windows作为推送程序.当我在终端中运行此命令时,出现以下错误:'''{错误":错误请求",描述":无法将正文作为JSON对象读取"}'''''更多细节 :错误图片

I am testing push notification for android development and i am currently use windows as pusher. When I run this command in terminal , i have this error : '''{"error":"Bad Request","description":"Failed to read body as a JSON object"}''' for more details : Error image

推荐答案

通过更改json数据的格式解决(针对 windows 用户)来自: -d'{"interests":["hello"],"fcm":{"notification":{"title":"Hello","body":"Hello,world!"}}}'

Solved by changing the format of json data (for windows users) from : -d '{"interests":["hello"],"fcm":{"notification":{"title":"Hello","body":"Hello, world!"}}}'

至: -d"{\" interests \:[\" hello \],\" fcm \:{\" notification \:{\" title \:\" Hello \,\" body \:\"你好,世界!\}}}"

这篇关于推送通知失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆