WKURLSessionRefreshBackgroundTask is not firing after being registered
| Originator: | sarah.maclean | ||
| Number: | rdar://30186445 | Date Originated: | 25-Jan-2017 10:34 AM |
| Status: | Open | Resolved: | |
| Product: | watchOS + SDK | Product Version: | watchOS 3.0 |
| Classification: | Important | Reproducible: | Yes |
Summary: After properly scheduling a background refresh for every hour, the task for the refresh doesn't seem to be firing and the completion is never called. This means that the watch app information is never refreshed unless it is quit and restarted. Steps to Reproduce: 1) Install Xcode 2) Open project 3) Schedule a refresh using scheduleBackgroundRefreshWithPreferredDate provided by WKExtension. This is scheduled in the applicationDidBecomeActive function int the ExtensionDelegate. 4) Run the project on an apple watch (not simulator), with watchOS 3.0. 5) After building and running the project, the logs show that the background refresh has been scheduled. 6) Return to watch face. 7) Drop wrist so that app is backgrounded. 8) Keep it backgrounded for as long as the refresh task is scheduled for. Expected Results: After the amount of time has passed that it is time for the scheduled refresh, the task should be fired and received by "- (void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks". After it is received the completion should be called so that background refresh task is run and the data in the app is updated when it is next opened. Actual Results: The refresh task is never fired from what can be seen on the logs, even if it's scheduled for 5, 10, or 20 seconds after being backgrounded. the "-(void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks" function is never run. When the app is reopened the data is the same as before and does not include new data. Version: watchOS 3.0 Notes: It seems that other people are having the same problem: https://forums.developer.apple.com/message/202902#202902 Configuration: This bug occurs using Xcode 8.2.1 and all version 3.0 of watchOS. The project is written in objective-c.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!