Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Aibek D.
9 years agoNew member | Level 1
SwiftyDropbox and support for multiple accounts
We're migrating from Dropbox iOS SDK to SwiftyDropbox and we need to support a vital feature: support for multiple accounts. There's not much documentation about that (none, actually).
Typical single-user case which is perfectly handled by Dropbox class, as far as I can see, simply calls similar appropriate methods on DropboxAuthManager.
My questions:
1) Is Dropbox class created only for simplifying interface and can be not used at all in the project? (E.g. not making a call setupWithAppKey(appKey) on app launch)
2) DropboxAuthManager has a singleton property sharedAuthManager. Was it created only to support Dropbox class?
3) Do you have any other advices for multiple accounts support?
Thanks in advance.
1 Reply
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
Thanks for the feedback! We certainly should improve the documentation/tutorial to include information about using multiple accounts.
Anyway, I believe Dropbox.authorizeFromController is meant for the use case where there's only a single account.
If you need multiple accounts, you should use DropboxAuthManager.sharedAuthManager.authorizeFromController and DropboxAuthManager.sharedAuthManager.handleRedirectURL. You will always need to supply your app key though, whether or not you want to link one or many accounts.
You can get all of the stored access tokens using DropboxAuthManager.sharedAuthManager.getAllAccessTokens(), and construct a client using whichever one you want using DropboxClient.init.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!