Reputation: 1727
From what I understand from the documentation DidFinishEventsForBackgroundSession is supposed to be called when the task completes (the transfer completes)
I have a progress bar that updates based on the totalBytesSent / totalBytesExpectedToSend, allowing me to tell when it's supposed to be done.
I've also followed the instructions (in regard to uploads) in the walkthrough from the Xamarin at the following link:
background transfer walkthrough
I put a breakpoint inside the DidFinishEventsForBackgroundSession and it never seemed to get called.
Edit: What is the proper way to detect completion of tasks (or being notified, when in background, for throwing a notification so the user can know it's done)
Upvotes: 2
Views: 841
Reputation: 411
Was having the same issue until I switched to using didCompleteWithError. Reading Apple's documentation suggests didCompleteWithError tells the delegate that the task finished. This is what I have been using and working like a charm. You can check the error parameter to see if returned an error or if it's null.
Upvotes: 1