Last active
April 15, 2020 00:00
-
-
Save androuino/d56d94b0a5d26acc397f811e39fafb1b to your computer and use it in GitHub Desktop.
Copy of my main.js script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parse.Cloud.define('pingReply', async (request) => { | |
/* | |
var customData = request.params; | |
console.log("the customData is " + customData); | |
var sender = JSON.parse(JSON.stringify(customData)); | |
const query = new Parse.Query(Parse.Installation); | |
console.log("the query is " + query); | |
query.equalTo("installationId", sender.user); | |
const results = await query.find(); | |
console.log("the results is " + results); | |
console.log("the user is " + results.get("user")); | |
console.log("the sender is " + results.get("sender")); | |
var data = { | |
"user": results.get("user"), | |
"gcmSenderId": results.get("sender") | |
}; | |
Parse.Push.send({ | |
where: query, | |
data: data | |
}, { success: function() { | |
console.log("PUSH OK"); | |
}, error: function(error) { | |
console.log("PUSH ERRO: " + error.message); | |
}, useMasterKey: true }); | |
*/ | |
//return data; | |
try { | |
let itemQuery = new Parse.Query("sender"); | |
const result = await itemQuery.find({useMasterKey:true}); | |
return result; | |
} catch(error){ | |
console.log(error); | |
return error; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment