【发布时间】:2020-12-27 22:57:06
【问题描述】:
我正在使用 ESP32 开发 Android 应用程序。我想要一个系统,当我按下按钮(硬件按钮)时,它会向 android 应用程序发送通知。我已将数据连接到 firebase 并使用推送器发送通知。我的设备是集成的。但是,我无法执行推送通知 curl 命令。 当我执行 curl 命令时(我什至下载了 curl.exe 并设置了路径):
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer **Secret Key**" \
-X POST "https://**Instance ID**.pushnotifications.pusher.com/publish_api/v1/instances/**Instance ID**/publishes" \
-d '{"interests":["hello" ,"fcm":{"notification":{"title":"Hello", "body":"Hello, world!"}}}'
我在命令提示符中遇到错误,如下所示:
C:\Windows\system32>curl -H "Content-Type: application/json" \
curl: (6) Could not resolve host: \
C:\Windows\system32> -H "Authorization: Bearer **Secret Key**" \
'-H' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32> -X POST "https://**Instance ID**.pushnotifications.pusher.com/publish_api/v1/instances/**Instance ID**/publishes" \
'-X' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32> -d '{"interests":["hello"],"fcm":{"notification":{"title":"Hello", "body":"Hello, world!"}}}'
'-d' is not recognized as an internal or external command,
operable program or batch file.
【问题讨论】:
标签: android curl push-notification pusher