Post

Replies

Boosts

Views

Activity

EKSource calendarsForEntityType returns nil despite valid calendars
Since updating to Sonoma and using XCode 15.0.1 to adapt my app's code base to deal with new requirement for Full Access to calendars, I am simply unable to find ANY valid calendars of type EKEntityTypeEvent despite having about 8 different EKSources available (which I can see and access in the macOS Calendar app), and which do contain calendars I used to be able to read/write to before I updated to Catalina. But the call to EKSource's calendarsForEntityType function always returns nil. I have successfully obtained Full Access permission (which in any case is obviously so because otherwise I would not get access to all the EKSource items). I've also rebooted several times. I have Calendar selected under Resource Access items for the app's capabilities. Does anyone have any idea why, or a workaround? Looks like a potentially serious bug at this point.
1
0
640
Oct ’23
scheduleBackgroundRefresh limitations
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?!
4
0
2.9k
Sep ’17