Manage single vs multiple Dropbox users with DropboxClientsManager
masterThe DropboxClientsManager handles the lifecycle of Dropbox accounts within your app.
Single User Flow
- Call
setupWithAppKey(orsetupWithAppKeyDesktop) in your App Delegate. - The manager checks for stored tokens. If none exist, call
authorizeFromControllerV2to start OAuth. - Handle the redirect in the App Delegate using
handleRedirectURL. - Use
DropboxClientsManager.authorizedClientto make calls. - To logout, call
unlinkClients.
Multiple User Flow
- Use
setupWithAppKeyMultiUser(orsetupWithAppKeyMultiUserDesktop). - When an OAuth flow completes via
handleRedirectURL, the app must persistently save thetokenUidfrom theDropboxOAuthResult. - To switch users or authorize a new one, use
reauthorizeClient(tokenUid:). - To logout a specific user, use
clearStoredAccessTokeninDropboxOAuthManager.