Device: iOS11.1 iPhoneX device and iOS11.2.5 iPhone7 devices.
What is my problem:
My application use afnetworking library to send request and get latest information from server.
It work well when app is foreground.
When the application is in background, I use silent push to awake my app and send the same request to server to get the latest information.
I have received silent push and application is awaked, but when I send the request, I cannot receive any response.
After I raise application to foreground, I can get response and it tell me the error is -1001(timeout), sometime, the error is -1005(network access error)
It seems like on iOS11, the background request is not work.
anybody tell me what is the problem?
is it any method to solve this problem?
----my request----
I am using AFHTTPSessionManager's POST method to send request.
----AFHTTPSessionManager's Interface----
- (NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(id)parameters
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
----initialize----
configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
the background request have worked well on iOS9 and iOS10 devices.