Cannot convert return expression of type 'SessionDataTask' to return type 'URLSessionDataTask'

Viewed 235

I'm not anymore able to use URLSession.shared.dataTask with the last FBSDKCoreKit and FBSDKLoginKit update.

struct Networking {

    func customDataTask(urlRequest: URLRequest, completion: @escaping (Result<Data, NetworkError>)->()) -> Foundation.URLSessionDataTask {
        let urlRequest1 = URLRequest(url: URL(string: "Your url/API links here")!)
        let task = URLSession.shared.dataTask(with: urlRequest1) { (data, response, error) in
            print("TEST")
        }
        return task
    }
        
}

An error:

Cannot convert return expression of type 'SessionDataTask' to return type 'URLSessionDataTask'. FBSDKCoreKit.URLSession:3:15: Found candidate with type 'SessionDataTask'

0 Answers
Related