From the course: Apple watchOS App Development: Advanced APIs

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

userInfo in background apps

userInfo in background apps

From the course: Apple watchOS App Development: Advanced APIs

Start my 1-month free trial

userInfo in background apps

- [Instructor] Now, your count might be different than mine from the last video, since that is dependent on your system. There's that big, nasty error message about file not found. It could not be opened. This is a simulator bug, and you can usually ignore it. This bug is related to the user info property of refreshed background tasks, and gives us a good opportunity to discuss user info in a bit more detail. Go ahead and close the console, so we can get rid of all that mess. Now, to work around this error, you access user info in the background task. So, just under refresh date, I'm going to add a line for the user info. So I'm just going to add let userInfo = backgroundTask .userInfo. And I'm going to make sure I put a return here, because that's not a real line. This is actually too long a line here. You can see that by getting rid of our navigation pane. And you can see that's a real line there. Now, change the user info in the scheduled background refresh underneath from nil to…

Contents