parse.com - iOS Detect If User Doesn't Interact With Local Notification -



parse.com - iOS Detect If User Doesn't Interact With Local Notification -

i'm building application user must finish task within 5 minutes of receiving local notification. if task completed nil happens if task not completed need run parse cloud code function.

my issue if user doesn't interact local notification need perform parse cloud function. i'm having ton of difficulty trying because of ios's picky background modes , multitasking rules.

so far app works great, if action not completed , user not in app can't perform code.

if point me in right direction appreciate it. if need anymore details please allow me know!

cloud code- cloud code perform if user not finish task within 5 minutes of reciving local notifcation:

parse.cloud.define("chargecustomer", function(request, response) { stripe.charges.create({ amount: request.params['amount'], currency: "usd", customer: request.params['customerid'] }, { success: function(customer) { response.success(charge.id); }, error: function(error) { response.error("error:" +error); } }) });

thanks!

have looked running job in cloud code?

say create new class named "pushnotification". add together boolean column/property class named "handled".

when user gets , views force notification, update "pushnotification" object corresponds force notification , set "handled" yes/true.

you write simple job ran every x minutes. might this:

parse.cloud.job("checkpushes", function (request, status) { var pushnotification = parse.object.extend("pushnotification"); var query = new parse.query(pushnotification); // limit query objects created more 5 minutes ago query.lessthan("createdat", new date(new date().gettime() - (1000 * 60 * 5))); // limit query objects "actionperformed" not equal "true" query.notequalto("handled", true); query.each(function (pushnotification) { // don't forget set "handled" true // same items don't maintain popping up... }); });

you can find out more cloud code (specifically background jobs) here.

ios parse.com ios8 uilocalnotification cloud-code

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -