gpt4 book ai didi

javascript - 如何使用 Parse.com Cloudcode 发送推送通知

转载 作者:行者123 更新时间:2023-12-02 12:39:11 24 4
gpt4 key购买 nike

我想在 Parse.com 上使用 Cloudcode 发送推送通知。

推送通知应发送到订阅特定 channel 并触发服务的所有 Android 设备。

最佳答案

您所需要的只是一个安装查询以及随附的推送。例如:

var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.containedIn("user", userlist);
Parse.Push.send({
where: pushQuery,
data: {
alert: "Your push message here!"
}
}, {
success: function() {
response.success("pushed");
}, error: function(error) {
reponse.error("didn't push");
}
});

该安装查询可以是基于 channel 的查询,并且您可以为推送查询制定其他规范,如文档中给出的:

Parse Docs

关于javascript - 如何使用 Parse.com Cloudcode 发送推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25770167/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com