我试图通过php网站向我的应用的所有Android用户发送消息。我使用以下代码,但我遇到了问题。
我不知道获取to:
的唯一密钥。我想将它发送给该应用程序的所有Android用户。
curl -H "Content-type: application/json" -H \
"Authorization:key=<Your Api key>" -X POST \
-d '{"to": "<aUniqueKey>","data": {"hello": '\
'"This is a Firebase Cloud Messaging Device Group Message!"}}'
https://fcm.googleapis.com/fcm/send
答案 0 :(得分:0)
to
参数所需的值为Registration Token generated in the Android App side。
对于您的用例,我建议您使用Topic Messaging。自动为每个用户订阅特定主题。