Hello,
I'm trying to take first steps with the dropbox linkage in my iOS App.
Here I have following problem:
I'm opening a ViewController (not the first one) and want to list all files which are in the root folder in my Dropbox.
But when I call "
client.files.listFolder(path: "").response { response, error in ..."
it just jumps over the entire code without an errormessage.
I have not found any solution yet so I'm hoping someone of you can assist me.
Below you see my code.
Thank you
override func viewDidLoad() {
super.viewDidLoad()
if (DropboxClientsManager.authorizedClient == nil) {
DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: self, openURL: {(url:URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) })
}
else {
print("User is already authorized!")
}
if let client = DropboxClientsManager.authorizedClient {
client.files.listFolder(path: "").response { response, error in
if let result = response {
for entry in result.entries {
self.dataFromServer.append(DataFromServer())
self.dataFromServer[self.dataFromServer.count-1].folderName = entry.name
}
} else {
print(error!)
}
}
}
}