I'm using a standalone Parse server, trying to send a push notification to multiple Installations.
Parse Server won't let me query the Installation collection from Cloud Code, returning the following error:
Error handling request: ParseError {
code: 119,
message: 'Clients aren\'t allowed to perform the find operation on the installation collection.' } code=119, message=Clients aren't allowed to perform the find operation on the installation collection.
The query in Cloud Code looks like this:
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.containedIn('user', users);
pushQuery.find({ ...
What's the proper way to get a list of Installations for a set of Users and send pushes to all of them?
I've also tried to get Cloud Code to use the masterKey by calling Parse.Cloud.useMasterKey();
immediately before the query. No effect and the master key is not included in the query request headers.
This is because Parse.Cloud.useMasterKey()
is deprecated since Parse-server version 2.3.0. You now need to make use of useMasterKey: true
in your query.
Eg:
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.containedIn('user', users);
pushQuery.find({useMasterKey: true }).then(function(results) {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With