We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
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...
Здравко
Legendary | Level 20
odoerlek wrote:... While I can connect users, their tokens are expiring and not auto-refreshing as expected.
...
Hi odoerlek,
I don't know what you expect to be, but to work refresh process, your Dropbox client object needs to be initialized with refresh token as well as other credentials like application key, not only access token, as you do:
odoerlek wrote:...
...
self.clients[tokenUid] = DropboxClient(accessToken: accessToken.accessToken)
...
...
Hope this gives direction.
odoerlek
6 months agoExplorer | Level 3
Generally, in the application, I want to enable the user to log in to multiple Dropbox accounts so that they have access to all of them in one place. Initially, when I set it up for a single account, it worked well. However, after switching to 'setupWithAppKeyMultiUserDesktop', everything works until the access token expires, which is after four hours. After this time, the token does not refresh automatically as it did for a single account, which means I don't have access to the account data (unless I log in again, but as we know, the access token will be new then, but still only valid for 4 hours).
- Здравко6 months agoLegendary | Level 20
odoerlek wrote:... Initially, when I set it up for a single account, it worked well. However, after switching to 'setupWithAppKeyMultiUserDesktop', everything works until the access token expires, ...
odoerlek, Single user or multi user implementation doesn't affect how every single client object behaves. The only difference is (or has to be at least) that you have one or multiple client objects.
As seems you have changed something else too. I don't know what, but you should know. Dropbox client object may be initialized in different ways as could be seen here. Most of them support automatic refresh (all but one actually). You have selected in your code the only that doesn't support it. 🤷 There is static token initialization - no refresh!
Take a bit more care. 😉
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!