1

iOS 13.3 でのみ要求タイムアウトを取得しますが、iOS 13.3 未満では正常に動作しています。

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." 
UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x60000193b060 
{Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, 
_kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <8F950888-C8E6-47B6-9FD8-78719B4FD231>.<8>,
 _NSURLErrorRelatedURLSessionTaskErrorKey=(
        "LocalDataTask <8F950888-C8E6-47B6-9FD8-78719B4FD231>.<8>"
    ), 
NSLocalizedDescription=The request timed out., 
NSErrorFailingURLStringKey=https://api.url.com/oauth, 
NSErrorFailingURLKey=https://api.url.com/oauth, _kCFStreamErrorDomainKey=4}

これについて私を助けてください。

コード スニペットは -

func commonNetworkCallWithHeader(header :[String:String],url:String,method:HTTPMethod,parameters : [String:Any]?,completionHandler:@escaping (JSON?,String?)->Void) {
    let configuration = URLSessionConfiguration.background(withIdentifier: "")
    let manager = Alamofire.SessionManager(configuration: configuration)
    manager.session.configuration.timeoutIntervalForRequest = 60
    manager.startRequestsImmediately = true
    manager.request(url, method: method, parameters: parameters, encoding: JSONEncoding.default, headers: header).responseJSON { (response) in
        if(response.result.isSuccess){
            if let data = response.result.value{
                let json = JSON(data)
                completionHandler(json,nil)
                return
            }
        }
        completionHandler(nil,response.result.error?.localizedDescription)
    }
}
4

1 に答える 1