I am using watchOS4 and calling scheduleBackgroundRefresh() to update complications on the watch face.
I am scheduling a new background update every time handleBackgroundTasks() is invoked, and when I run in simulator with 5 min refresh intervals everything runs fine - noting that the simulator does not get rate limited.
However, when I run on actual device (typically with 15 min updates requested), I find that it runs fine for a number of hours (updates intervals seem to be 20m to 30m, but I can live with that), but then goes for many hours without receiving a background refresh call at all, before eventually resuming again. This happened overnight and I wondered if it might relate to watch being inactive or perhaps to do not disturb mode even. However, it eventually started receiving regular updates again (without any intervention on my part) but then entered a very long pause period again in the middle of the day - many hours without refresh.
Given the very long time periods involved it is near impossible to monitor via XCode debugging. So I am wondering what could cause such long periods without background refresh being called. My understanding is that with active complications, I should be receiving at least 4 updates per hour, and that there is no specific rate limit on calls to scheduleBackgroundRefresh().
I also note that my code may (potentially) make several calls to scheduleBackgroundRefresh during its background processing as I always firsly set it to 15 mins, but *may* make a sightly later repeat call to delay it further after I get data back and examine its validity. According to docs, making a subsequent call should simply cancel the previous call and replace it with one with the new request refresh period. One concern I have is that there is an unstated rate limit calls which might be counting my canceled background calls as part of a budget, which is a potential explanation for odd behavioiur I've noted.
I just can't understand the odd timings, and it makes for a pretty useless complication. Any ideas?!