2
A
回答
4
你不需要查询来发送推送到频道。只需拨打Parse.Push.send并向数据对象添加通道数组。
Parse.Push.send({
channels: [ "channel_name" ],
data: {
alert: "Alert message"
}
}, {
success: function() {
response.success("Push was sent");
},
error: function (error) {
response.error("Could not send push " + error)
}
});
请务必不要在通道名称中使用空格和大写字母。该频道不会被添加到后端的订阅频道中。
4
所有你需要的是一个安装查询,以及随附的推送。例如:
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");
}
});
在安装查询可以基于一个通道上查询,并有多种规格,你可以为推查询,文档中给出:
1
1)添加
Parse.initialize("APPLICATION_ID", "JAVASCRIPT_KEY");
2)启用Java脚本推送通知在Parse.com
3)下载Java脚本的项目 “解析JS-空白”
4)创建安装通道对象
5)发送请求。
Parse.Push.send({
channels: [ "Giants","Vaquar" ],
data: {
alert: "Vaquar Alert Message."
}
}, {
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
alert("(error"+eval(error));
}
});
相关问题
- 1. Parse.com用数据发送推送通知
- 2. 如何使用Delphi通过Parse.Com发送推送通知?
- 3. 使用CloudCode发送目标推送通知
- 4. Parse.com回复推送通知
- 5. 推送通知:如何使用Pubnub向特定设备发送推送通知?
- 6. 如何使用parse.com通过JSON推送通知[Android]
- 7. Parse.com推送通知不起作用
- 8. Parse.com - 将消息从Parse.com发送到iOS应用程序,不像推送通知
- 9. 使用Malcom API发送推送通知
- 10. 使用Google GCM发送推送通知
- 11. 如何发送推送通知
- 12. 如何发送推送通知
- 13. parse.com:从我自己的CMS发送推送通知
- 14. 如何使用Parse.com的推送通知功能来更改PFObjects?
- 15. 发送通用推送通知 - Xcode
- 16. Parse.com Android的推送通知包含URL
- 17. Android parse.com无法接收推送通知
- 18. 地理推送通知与Parse.com
- 19. parse.com action-loc-key推送通知
- 20. 使用raix发送推送通知时没有任何事情发生:推送
- 21. 如何一次发送多个推送通知使用Android推送锐利库?
- 22. 用VB.NET发送组播推送通知
- 23. 如何使用OneSignal发送自定义声音推送通知?
- 24. 如何使用One Signal + PHP + Server API发送推送通知?
- 25. 如何发送fcm推送通知使用goalng fcm服务器
- 26. 如何使用java在iphone中发送推送通知
- 27. 如何使用PushMeBaby示例发送Apple推送通知?
- 28. 如何使用yammer api发送推送通知
- 29. 如何使用Rails gems RPush或Houston发送推送通知?
- 30. 如何使用Mainline发送推送通知
如果我想将这个消息发送给大家? 我应该将'channels'设置为“Everyone”吗? – 2015-12-07 13:54:44
您的代码有错误。 – zygimantus 2015-12-17 20:49:40