I want to send push notifications to my users if my db gets new entry in table , My parse cloud code for that is given below, Please tell me how do i configure in backendless that cloud code to send push notification;
Cloud code in parse:Below code is for sending Push notification from parse to my users after inserting data into db or deleting data from db
Parse.Cloud.afterSave(“TABLE NAME”, function(request) {
var query = new Parse.Query(Parse.Installation);
query.equalTo(‘channels’, ‘CHANNEL NAME’);
query.equalTo(‘Id’, request.object.get(‘Id’));
var fileUploaded = request.object.get(‘fileUploaded’);
if (fileUploaded!=null && fileUploaded==true) {
Parse.Push.send({
where: query, // Set our Installation query
data: {
PROCESS_MEDIA: request.object
}
}, {
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
}
});
}
});
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.afterDelete(“TABLENAME”, function(request) {
var query = new Parse.Query(Parse.Installation);
query.equalTo(‘channels’, ‘CHANNEL NAME’);
query.equalTo(‘Id’, request.object.get(‘Id’));
var fileUploaded = request.object.get(‘fileUploaded’);
if (fileUploaded!=null && fileUploaded==true) {
Parse.Push.send({
where: query, // Set our Installation query
data: {
PROCESS_MEDIA: request.object
}
}, {
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
}
});
}
});