Greetings all,
I have an interesting problem. When the user wears the watch, my app's complication updates approximately every 15 minutes. Although it is not a standalone app, it only uses the iPhone app to do a one time initialization. After that, all network access for data is done by my WatchOS app. Same with the complication. That's great.
But when my watch is on the charger my app stops updating. First the app is killed by WatchOS after an unknown amount of time. Then it is loaded in memory, but never updates the complication. When I tap on my complication the app starts and it's obvious that it is loaded in memory because it starts so fast.
If the watch gets an overnight WatchOS update and then the watch reboots itself, it is not even loaded into memory. Meanwhile Apple's Stock app is updated properly even after the watch rebooted and is still on the doc.
I've gone though and reviewed all of my code, ensured the any files that are accessed while the watch is locked don't have file protection enabled, and yet no luck.
Is background refresh really the way to do this or should I scrap that and use complication notifications instead?
I have an interesting problem. When the user wears the watch, my app's complication updates approximately every 15 minutes. Although it is not a standalone app, it only uses the iPhone app to do a one time initialization. After that, all network access for data is done by my WatchOS app. Same with the complication. That's great.
But when my watch is on the charger my app stops updating. First the app is killed by WatchOS after an unknown amount of time. Then it is loaded in memory, but never updates the complication. When I tap on my complication the app starts and it's obvious that it is loaded in memory because it starts so fast.
If the watch gets an overnight WatchOS update and then the watch reboots itself, it is not even loaded into memory. Meanwhile Apple's Stock app is updated properly even after the watch rebooted and is still on the doc.
I've gone though and reviewed all of my code, ensured the any files that are accessed while the watch is locked don't have file protection enabled, and yet no luck.
Is background refresh really the way to do this or should I scrap that and use complication notifications instead?
After much testing with passcode set/not set on various watches, I've determined that if there is no passcode set on the watch, the app updates the complications when on the charger. If the passcode is set then I get the "operation not permitted" error. Perhaps the temp files are created with complete file protection and as such are not allowed when the watch is locked.
So the issue was not having the watch on the charger but rather that the device was locked. Furthermore, my app is no longer dead when I take the watch off the charger in the morning.
So the issue was not having the watch on the charger but rather that the device was locked. Furthermore, my app is no longer dead when I take the watch off the charger in the morning.