nightscout / nightguard

iOS and WatchOS Client for the Nightscout CGM System
GNU Affero General Public License v3.0
243 stars 158 forks source link

No more background alarms #290

Closed motinis closed 9 months ago

motinis commented 9 months ago

So I've noticed this the last couple of months. I have Nightguard on my phone set up with 25 minutes low prediction. This used to work very well - even if I didn't have my phone unlocked or I was using other apps, I would usually get an alert from Nightguard within 3-4 minutes (so e.g. with 21 minutes predicted to the low). These have definitely saved us a few times in the past. We're now no longer getting these at all (and notifications are enabled in settings for Nightguard)

I think this maybe related to iOS changes - maybe the notifications need to be changed to be time sensitive and/or critical?

Thank you!

dhermanns commented 9 months ago

Did you have Notifications activated in Nightguard? And do you have the nightguard lockscreen widget configured? If so, you should get background alerts at least every 20 minutes.

But you are right, you will get the predicted lows only if you have the app in foreground. This is because I don't have the predicted values when in background. That was one of the reasons why background updates didn't work as expected sometimes. So I had to restrict this type of alarms to foreground only. Sorry.

motinis commented 9 months ago

Did you have Notifications activated in Nightguard? And do you have the nightguard lockscreen widget configured? If so, you should get background alerts at least every 20 minutes.

Yes to the first, and no to the second. I will add that on. Still though, I wonder if the notifications could be updated to be time sensitive and/or critical (maybe as part of the nightguard settings) to help shorten the notification time?

dhermanns commented 9 months ago

You mean to get alerts more often then every 20mins?

motinis commented 9 months ago

Yes - to try and see if we can get it more than every 20 minutes.

Although e.g., maybe a Loop / (x)APS extension which pulls their predicted curves and uses that? I'm not sure what kind of logic you can drive once you get the data when you're in the background.

It could be the only way to handle with the predicted low we just need to setup an additional IFTTT/Push

dhermanns commented 9 months ago

You won't get more often updates. That is an Apple restriction for background updates. But it works very well when using the lockscreen widget. During most of the day you should get alarms within 5-10 minutes.

motinis commented 9 months ago

Just trying the lock screen widgets - the values displayed there seem to have quite a bit of lag in terms of updating (even if e.g., I just had Nightguard open). I think it may be a good idea to use actual timestamps there rather than e.g., -3m, -8m, etc. since those aren't accurate if the data isn't being updated frequently enough.

dhermanns commented 9 months ago

This is why the rectangular widget has a timestamp 😉

motinis commented 9 months ago

Not on my phone - iOS 16.6.1. I just see the relative times

dhermanns commented 9 months ago

Yes - relative to the timestamp displayed. 11:01 o'clock in this case:

image

motinis commented 9 months ago

Maybe I need to update? Mine doesn’t have that last line with the time stamp on it. I’m using a test flight version though I think (with 5 bg intervals for lows)

dhermanns commented 9 months ago

Yes - that could explain your problems, too ;-)

motinis commented 9 months ago

Yes. Updating helped. Although annoyingly it is cropping the top line and the timestamp. I don’t know if I can resize the widget area.

motinis commented 9 months ago

Can’t be resized. Oh well. Still I can see the values well enough. Thank you!!

motinis commented 9 months ago

Changing the date widget to the nightguard one is also very nice. Gives the timestamp too

motinis commented 9 months ago

Although the timestamp for the date widget seems buggy. Before it was showing 12:00 when I added it, and now it's showing 10:40 (other widget is showing 12:47). Switching to an alternative date widget and back and now it's showing 20:40.

dhermanns commented 9 months ago

Apple schedules background update for each widget. So this can happen.

motinis commented 9 months ago

Lagging updates / different frequency I could understand - the issue is that the times seem completely off. Like resolving to different time-zones but in an inconsistent way. Looks like a weird bug to me.