WKURLSessionRefreshBackgroundTask

Hi,


im trying to play with the Apple WatchBackgroundRefresh Demo App before upgrading my own WatchApp with the new BackgroundRefresh features.

Apple DemoCode:

https://developer.apple.com/library/prerelease/content/samplecode/WatchBackgroundRefresh/Introduction/Intro.html


With watchOS3 Beta 2 (Xcode 8 Beta2) i got the Demo running but the WKURLSessionRefreshBackgroundTask never got called (tested with different URLs, but the WKApplicationRefresh seems to work).

After upgrading to watchOS3 Beta3 (Xcode 8 Beta3) the handle(_ ) constantly gets called with WKApplicationRefreshBackgroundTask after sending the App into Background, even without scheduling a BackgroundRefresh ? The WKURLSessionRefreshBackgroundTask never gets called either.


Anyone got this working ?


Best regards Marco

Daniel,


I didn't understand the step 3 of your explanation..


Can you provide an example?

It seems as though this still isn't working in the GM released today. How is it possible to develop with this API if it doesn't actually work?

Has anyone who's following this thread submitted a radar on this. Would love to dupe. At this point, I'm not really sure how best to articulate the issue(s).


Also, I noticed that the sample app listed above has been removed....

Exactly. I'm working on this problem since first beta release...

How are people working around this issue? Surely with the watchOS 3 release coming up shortly people are finding ways to get their app ready to go even with this problem?

Is there something new here?

watchOS 3 and Xcode 8.0 are released now and it seems still broken.

Just for an update, I reached out to Apple using a DTS over a week ago and only got 1 reply so far asking if I have used the sample project. I'll report back if I hear more. For me, the sample project also does not have WKURLSessionRefreshBackgroundTask called either.

Any updates, or is this still not working? I'm having issues as well.

No updates on my end. Apple has completely ignored me on the (paid) DTS ticket.

Accepted Answer

Sorry to see that folks are running into issues here.

A few things...


1. On the Simulator (Watch), it appears that this is not working correctly and we are investigating the issue.

2. On device, the sample code works but you must add the app to the Dock first. Additionally, URLSession tasks have a decently wide window in which to fire although, in our testing, the tasks are generally being served within ~10 minutes.


I hope that helps. Sorry for the confusion.

Hi Behrens,


Unfortunately, on device, the sample code doesn't work either (see radar 26972292). The download itsself does complete (and you can see the file in the caches folder) however, the notification to say the download has finished is never received.


I am also not able to get this working. No matter how long I wait, I never receive a WKURLSessionRefreshBackgroundTask. The sample code has never been updated and also does NOT work.

WKURLSessionRefreshBackgroundTask
 
 
Q