I'm trying to get my task manager app to automatically badge the app icon with the number of tasks due today. I have tried two different solutions, but none are ideal or work exactly how I want.
Solution 1: I set up local notifications to send a notification at 12 in the morning when a task is due that day. The problems are, one, I want to badge the app AFTER the notification is sent but I can't figure out how to do that, and two, every time a new task is created or a due date on another is edited, I have to delete all scheduled local notifications and then reschedule them all. This does not seem efficient, especially because I have to sort through my core data objects to get the due dates.
Solution 2: I set up my app to refresh in the background so the icon badges update, then just updated the badge number anytime a new task or change of due date was made in app. The problems with this are that one, obviously it's kind of a waste of energy to refresh in the background when really I only need it to refresh at the beginning of the day, and two, I can't schedule when it actually refreshes.
Is there another way I should be going about this?