You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
odoerlek
6 months agoExplorer | Level 3
Issues with Token Expiry and Auto-Refreshing in SwiftyDropbox for multiusers
Hi everyone, I'm having trouble with managing multiple users in my app using SwiftyDropbox. While I can connect users, their tokens are expiring and not auto-refreshing as expected. Here are some...
Greg-DB
6 months agoDropbox Staff
odoerlek Здравко is correct; in order for the SDK to perform the refresh for you automatically, the client needs to have the necessary credentials, such as the refresh token. In your code you are creating DropboxClient objects with only the access token but not the refresh token, so it can't refresh for you automatically.
I recommend using the client management functionality built in to the SDK whenever possible. For instance, you can use use DropboxClientsManager.reauthorizeClient to switch between stored clients (including their refresh tokens), so that you can then use the DropboxClientsManager.authorizedClient provided by the client. Calling reauthorizeClient will update which client is returned by DropboxClientsManager.authorizedClient.
If you do want to create and manage the clients yourself though, you'll need to make sure you supply the refresh tokens as well, in which case it will catch and handle expired access token errors for you automatically.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,888 PostsLatest Activity: 2 days 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!