【发布时间】:2019-04-03 00:31:16
【问题描述】:
我正在开发一个 android 应用程序,我正在使用 Firebase API 在 android studio 中使用 HTTP POST 发送推送通知。我按照教程here 发送标题和正文。它工作正常。我想发送额外的信息,请建议我如何实现?这是我的代码:
...
JSONObject json = new JSONObject();
json.put("to", "/topics/" + "Greetings");
JSONObject info = new JSONObject();
info.put("title", "Hi");
info.put("body", "Good morning");
json.put("notification",info);
JSONObject data = new JSONObject();
data.put("extra_information", PreferenceUtils.getUserID());
json.put("extra_information", data);
...
【问题讨论】:
标签: android json firebase firebase-cloud-messaging http-post