android - Get notification when a user wants to add data to the database -


i'm begin working on recipe android app college final project, , want users able add recipes database. however, don't want data added right away, i'd receive notification whenever wants add recipe, can confirm myself. i'm using back{4}app way.

how can such thing in not-so-complicated way? thinking create admin account myself in app itself, there way send notifications said account? want able confirm recipe addition simple "confirm" button within app, require me create additional class pending recipes? need admin account in case?

all can achieve using cloud code.

parse.cloud.define("addrecipe", function(request, response) {     const query = new parse.query("recipe");     query.set("name", "name");     query.save({          success function(result) {               response(result);               //call push notification function client or cloud code when error nil           },          error: function(result, error) {           response(error);           }     }); }); 

this example of push notifications using cloud code. push notification not allow anymore client due secure reason. should subscribe channel

parse.cloud.define("pushsample", function (request, response) {     parse.push.send({         channels: ["channelname"],         data: {             title: "hello!",             message: "hello cloud code",         }    }, {         success: function () {             // push successful             response.sucess("push sent");         },         error: function (error) {         // push unsucessful         response.sucess("error push: " + error);         },         usemasterkey: true    }); }); 

you should implement logic app in order display recipes confirm admin.

var recipe = parse.object.extend("recipe"); var query = new parse.query(recipe); query.equalto("confirm", true); query.find({   success: function(results) {     //it display recipes confirmed   },   error: function(error) {     alert("error: " + error.code + " " + error.message);   }); 

you should setup admin system in app or website


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -