Skip to content

Commit

Permalink
update firebase and add poke endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmichels committed May 2, 2020
1 parent 9442b06 commit faaa7af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions firebase/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ exports.sendNotification = functions.https.onRequest((request, response) => {
"pushed_id":request.body.id,
}
}
else if(request.body.event==='poke'){
return;
}
else{
formdata = {
"app_key": process.env.app_key,
Expand All @@ -41,15 +44,15 @@ exports.sendNotification = functions.https.onRequest((request, response) => {
formData:formdata
},(err,httpsRes,body)=>{
if(err){
console.error("error:");
// console.error("error:");
console.error(err);
return;
}
else{
console.log("notification sent");
// console.log("notification sent");
return;
}
})

return response.send(request.body);
response.send(request.body);
return;
});
6 changes: 3 additions & 3 deletions firebase/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit faaa7af

Please sign in to comment.