I am facing below error when I am trying to list folder or get current account info. Please help
Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api.dropbox.com/2/users/get_current_account, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://api.dropbox.com/2/users/get_current_account}
Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api.dropbox.com/2/files/list_folder, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://api.dropbox.com/2/files/list_folder}
Below the code I have tried.
let client = DropboxClient(accessToken: "MYTOKEN")
client.users.getCurrentAccount().response { (response, error) in
if let result = response {
print(result)
} else if let error = error {
print(error)
}
}
client.files.listFolder(path: "").response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error in
if let result = response {
print(Thread.current) // Output: <NSThread: 0x61000007bec0>{number = 4, name = (null)}
print(Thread.main) // Output: <NSThread: 0x608000070100>{number = 1, name = (null)}
print(result)
} else if let error = error {
print(error)
}
}