cplaverty/KeitaiWaniKani

Background app refresh should update review total badge icon?

Closed this issue · 3 comments

Scenario

  1. I get 30 reviews to do so the app badge says "30"
  2. I do them on a web browser instead.
  3. (app immediately still says 30, which is expected)
  4. An hour later, I get 5 more reviews
  5. Notification and app badge says 35, but there are really only 5 reviews.

Is it possible to have the background app refresh handler pull the current (potentially updated) reviews info, update the badge icon to the actual current value if it is different, and reschedule the notifications with the recalculated totals?

That's exactly what the background handler should be doing. Unfortunately I don't have control over when or how often it runs. At least, not until iOS 13.

I see...
You're setting the setMinimumBackgroundFetchInterval at 5 minutes, so I figured it would have surely happened within an hour...

But you are correct. Simulating a background refresh did update everything 👍

Do you want me to leave this open as a reminder for iOS 13, or close it?

The only other solution to this would be to have notifications sent externally from a webserver every hour, rather than locally. But that opens up a ton of potential issues and maintenance that I don't think would be worth it any time soon.