I want to upload files to my server from my app. The code below is working great when app is active. If I press home button or open another app uploading stops.
I a
Change this line
[operation start];
to this
[operation setShouldExecuteAsBackgroundTaskWithExpirationHandler:^{
// Handle iOS shutting you down (possibly make a note of where you
// stopped so you can resume later)
}];
[manager.operationQueue addOperation:operation];
You can look at these links AFHTTPRequestOperation doesn't work after stand by mode and Alternative for enqueueHTTPRequestOperation in AFNetworking 2.0