PushController validateMasterKey always returning false.
In PishController the method validateMasterKey always fails and so without disabling this check I can't send push notifications.
Where are you sending push from? In parse-server, the master key must always be used, and push should not be sent from clients.
Yes I'm sending from cloud code. I use the method Parse.useMasterKey() before calling the push method.
the useMasterKey method doesn't work in cloud code. This was mentioned at the bottom of the readme, maybe we should put it back. The useMasterKey:true option must be passed to the options block of Parse.Push.send:
Parse.Push.send({
where: query,
data: { ... }
}, { useMasterKey: true });
added to wiki: https://github.com/ParsePlatform/parse-server/wiki/Push
Oh ok, I'm sorry. I might have missed that. Is this true also for other things like saving objects with specific acl? How can I save an object I don't have authorization for, if so?
You can pass the useMasterKey option to query and save calls:
object.save(null, { useMasterKey: true }).then(....
query.find({ useMasterKey: true }).then(....
and for count()? count({useMasterKey: true}) ?
also saveAll({useMasterKey: true}, objects) ?
The count one looks right, but swap the parameter order for saveAll.
Ok thanks!