I want to upload an image, using AFnetworking, which I have done successfully, now I want that to be uploaded even if it the app is in background execution , Is that possible?
I have tried this code:
- (void)applicationWillResignActive:(UIApplication *)application {
UIBackgroundTaskIdentifier backgroundIdentifier = [application beginBackgroundTaskWithExpirationHandler:^(void) {
[[AFHTTPClient sharedClient] cancelAllHTTPOperations]; }]; [application endBackgroundTask:backgroundIdentifier];
}
But it is showing error on shared-client selector and cancelallHTTPoperations method that they are undefined.
Any help will be greatly appreciated.