I'm using Parse for the backend of my app and am trying to send notifications to a specific user using cloud code. I believe I've got everything set up correctly, however I am getting the following error:
Error: unauthorized: master key is required
Which is odd as the master key is being used as part of the cloud code below:
Parse.Cloud.define("pushOneFTC", async (request) => {
var query = new Parse.Query(Parse.Installation);
let userId = request.params.userId;
query.equalTo('userId', userId);
Parse.Push.send({
where: query,
data: {
alert: "Fitcoins Gifted!",
title: userId + " sent you 1 Fitcoin! Thats not a lot..."
}
}).then(function() {
// Push was successful
}, function(error) {
// Handle error
}, {useMasterKey: true});
});
Have I missed something obvious here?