We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Garnik G.
4 years agoExplorer | Level 4
DropBox API auth error - {".tag" = "expired_access_token"}
Language Swift
iOS Version 14.4
We have app where we use dropbox api to allow our users to upload a document.
This app used to working perfectly two years ago.
Very recently we ma...
Garnik G.
Explorer | Level 4
I use SwiftyDropBox which was install by pod
The version number is 7.0.1
Please note this code was working fine before.
I do not use any access_token
What I use is this
DropboxClientsManager.setupWithAppKey("<my key>")
And this is the function I call when user click to dropbox button
func sendUsingDropBox() {
let dbClient = DropboxClientsManager.authorizedClient
if (dbClient != nil) {
isDropBoxModalOpened = false
startWI()
dbClient?.files.listFolder(path: "", recursive: true, includeMediaInfo: true).response(queue: DispatchQueue(label: "DbLfSerialQueue")) { response, error in
if let result = response {
self.dbFolders.removeAll()
result.entries.forEach({(metdaData) in
if !metdaData.description.contains("size=") && !metdaData.description.contains("size =") {
self.dbFolders.append(metdaData.pathDisplay!)
}
})
DispatchQueue.main.async {
self.stopWI()
self.showChooser()
}
} else if let error = error {
print(error.description)
DispatchQueue.main.async {
self.stopWI()
let alert = UIAlertController(title: "DropBox", message: error.description, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: THAlerts.Ok, style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: false, completion: nil)
}
}
}
} else {
isDropBoxModalOpened = true
DropboxClientsManager.authorizeFromController(UIApplication.shared,
controller: self,
openURL: { (url: URL) -> Void in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
})
}
}
Greg-DB
4 years agoDropbox Staff
Thanks for the additional information. From this I see you're using the 'authorizeFromController' method. You'll need to switch to using the 'authorizeFromControllerV2' method instead as shown here to support the new flow. Once you do so, the SDK will automatically handle short-lived access tokens and refresh tokens for you so you shouldn't receive 'expired_access_token' for new authorizations.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!