【发布时间】:2019-09-10 20:35:05
【问题描述】:
我可以使用其 id(通知密钥)向特定用户推送通知
public class SendNotification {
public SendNotification(String message, String heading, String notificationKey){
try {
JSONObject notificationContent = new JSONObject(
"{'contents':{'en':'" + message + "'},"+
"'include_player_ids':['" + notificationKey + "']," +
"'headings':{'en': '" + heading + "'}}");
OneSignal.postNotification(notificationContent, null);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
在一个信号文档中 https://documentation.onesignal.com/docs/sending-notifications
在那里我们可以向所有人(所有订阅者)推送通知
我如何使用代码向每个人推送通知,因为我可以发送给单个订阅者
【问题讨论】: