How to download a file over smb in Swift (tvOS)? NetFS and Cooca are not available for tvOS and when I'm using URLSession dataTask "smb://xxx.xxx.xxx.xx/share/test.txt" Swift tells me that smb is not a valid url.
Is there any solution to download a file over smb for tvOS?
Tried it with this code:
let url = self.smbManager.getFullUrl(fileName: self.file.name)
let request: NSURLRequest = NSURLRequest(url: url!)
let session = URLSession.shared
session.dataTask(with: request as URLRequest) { data, response, error in
print(data)
}.resume()
Error is: finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSErrorFailingURLStringKey=smb://xxx.xxx.xxx.xx/share/test.txt, NSErrorFailingURLKey=smb://xxx.xxx.xxx.xx/share/test.txt, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask .<1>" ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, NSUnderlyingError=0x2813a7c60 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
Thanks.