I am currently creating a habits tracker app,
I have created a database of habits for every user. Which every user can tick the toggle button to change its status from Open to Done.
The problem I have right now is, I want the habit to reset it status from Done to Open again everyday once the clock hits 00.00.
I have implemented a countdown timer to appear once they hit the toggle button and calculate what’s the remaining time left till reset and auto resets it, but the issue is the timer doesn’t run in the background, it only runs when the user is at the screen. Is there anyway for me to change the timer to run in the background, or is there a better way for me to reset the status automatically everyday?
There are indeed several ways you can implement a feature to reset habits in your app. Here are two options you can consider:
- Use a tool like Make or Zapier to watch the records and set up the conditions to reset them. This can be a good option if you want to automate the reset process and don’t need to manually trigger it.
- Set up an on-screen action on your home screen that takes the user to a “processor” screen. On the processor screen, you can use a list component to fetch the habits and a countdown component to mass update/reset them. When the habits are reset, you can use an action to navigate the user back to the home screen.
I hope these suggestions are helpful! Let me know if you have any questions or need further assistance.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.