Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

iOS Backgrounding Issues

JakovljevicIgorJakovljevicIgor USMember ✭✭✭

Hi Guys,

I have been struggling for some time with this issue. We have a .net PCL with our business logic which we use for our WPF, WinForms and MVC apps. This code we also wanted to reuse in the Xamarin App. That worked really good.

But we load data from a MVC Rest API and the synchronization process is coded in the PCL. So I cannot use NSURL to load the files. When I start the sync it loads the data for the first 10mins, then the app goes to the suspended state the sync stops and a Exception is throw stopping the app.

Is there a possibility to expand this 10 minute time period?

I have read the iOS Backgrounding Techniques and all related blog posts. But there seems not to be a solution for this, except switching to NSURL. Anyone with ideas?

The one with the answer gets a free beer from me.

Regards,
Igor

Best Answer

Answers

  • JakovljevicIgorJakovljevicIgor USMember ✭✭✭

    @BytesGuy - One quick question and you get your beer. Does the combination of NSOperationQueue and the NSURLSession work ? Because I have created a Queue of NSOperations and the operations are DownloadTasks that use the existing NSURLSession, but then the app is moved to the background, the operation execution stops.

    Was it supposed to do this, because in my research I thought that the NSOperationQueue will continue with the execution of the operations even after the app is send to the background.

Sign In or Register to comment.