I created new account and uploaded some pictures. I also created Access Token. Users haven't dropbox account and I want to display these pictures in my application. Can I do this without login page?
It works good with login page:
DropboxClientsManager.authorizeFromController(UIApplication.shared,
controller: self,
openURL: { (url: URL) -> Void in
UIApplication.shared.openURL(url)
})
let client = DropboxClientsManager.authorizedClient
But doesn't work with access token only:
let client = DropboxClient.init(accessToken: "...")
But it doesn't work:
client?.files.download(path: "/pics")
.response { response, error in
if let response = response {
let responseMetadata = response.0
print(responseMetadata)
let fileContents = response.1
print(fileContents)
} else if let error = error {
print(error)
}
}
.progress { progressData in
print(progressData)
}
I got error: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api-content.dropbox.com/2/files/download, NSErrorFailingURLStringKey=https://api-content.dropbox.com/2/files/download, NSLocalizedDescription=cancelled}