0
  • Users open my app and click on "start". So far so good.

  • After they click start they can put the app in the background and do what they want.

  • Every 30 minutes the app should send a notification if the users have not done at least 200 steps

How to do that notification part conditionally to the steps done?

I would also restrict the "step checking" time from 8 to 16, if possible.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Andrea
  • 31
  • 1
  • 5
  • You **can't** track distance (200 steps) if the app is closed. So at least instead of allowing a closed app, change your question to "_they can put the app in the background_". And stick to one question only: do you want to know how to track distance or how to schedule a notification? – Cœur Mar 14 '18 at 16:37
  • Thanks for the reply! I want to know how to schedule a notification every 30 minutes dependently on how many steps they perform every 30 minutes. I want to launch queryPedometerData every 30 min and then send a notification if needed. – Andrea Mar 14 '18 at 18:19
  • Thanks again for your patience. I don't want to relaunch the app since it will be running in the background. I want to schedule a notification. How can I do that? – Andrea Mar 14 '18 at 18:31
  • OK, I've clarified your question based on your comments (but it would have been best if you had done it directly). Last note I'll give: you don't _schedule a repetition depending on time of the day_, instead you schedule 1 single task to be called 30 minutes in the future, and this task will be recursive (it will re-schedule itself when executed). – Cœur Mar 14 '18 at 18:45
  • Thank you very much for your support. Really appreciated it. – Andrea Mar 15 '18 at 16:45

0 Answers0