adam
adam

Reputation: 405

WinJS (WP8.1): update secondary tile from background task

I'm struggling with problem with my first winJS app. What I want to do is to update all secondary tiles created by my app in interval of a couple of hours when Internet connection is available. I've managed to do that from my app, using a simple "update" button, but I cannot do that from bg task. As for now I'm testing it on timezone change trigger not to wait half an hour for the result. I put simple console.log at the beginning of the bgtask to confirm that it occurs and it does, but none of the live tiles updates. What piece of information am I missing about updating secondary live tiles from bgtask?

Upvotes: 0

Views: 125

Answers (1)

Brandon Paddock
Brandon Paddock

Reputation: 321

Sounds like you've figured it out, but the key piece is the GetDeferral method on the background task instance. You need to call that and then call the Complete method on that only after all your task's work is done (including waiting for promises from any async calls to complete).

Upvotes: 1

Related Questions