Parse.Cloud.define('sendPushToUsers', (req, resp) => {
const pushQuery = new Parse.Query(Parse.Installation);
const user = new Parse.Object('_User');
user.id = 'YXLPLWXJ71';
pushQuery.equalTo('user', user);
Parse.Push.send({
where: pushQuery,
data: {
alert: 'Hello Squad',
title: "GreatApp"
}
}, { useMasterKey: true })
.then(() => resp.success('Push was sent successfully.'))
.catch((error) => { resp.error(`Push failed: ${error.message}`); });
});
info: Ran cloud function sendPushToUsers for user undefined with:
Input: {"name":"value"}
Result: "Push was sent successfully." functionName=sendPushToUsers, name=value, user=undefined
(node:42607) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
TypeError: notification.setAlertTitle is not a function
In reference to https://github.com/parse-community/parse-server/issues/4015