以下是我发送解析推送通知的云代码:
Parse.Cloud.define('push1', function(response)
{
var query = new Parse.Query(Parse.Installation);
Parse.Push.send
({
where: query,
data:
{
alert: "Hai everyone..!!"
}
},
{
useMasterKey : true,
success: function()
{
response.success("true");
},
error: function(error)
{
response.error("error");
}
});
});
但我调用此函数的设备只接收通知。没有其他设备收到它。安装类中添加了3个设备。
这是我称之为此功能的应用代码
HashMap<String, Object> params = new HashMap<String, Object>();
ParseCloud.callFunctionInBackground("push1", params, new FunctionCallback<String>()
{
@Override
public void done(String ratings, ParseException e)
{
if (e == null)
{
System.out.println("WORKED: " + ratings);
}
else
System.out.println(e.toString());
}
});