Skip to content

Instantly share code, notes, and snippets.

@molidev8
Created August 16, 2022 16:51
Show Gist options
  • Save molidev8/1757d48b33502ab6ae91fe35b022c5c9 to your computer and use it in GitHub Desktop.
Save molidev8/1757d48b33502ab6ae91fe35b022c5c9 to your computer and use it in GitHub Desktop.
Setting up the Dropbox connection
private val config: DbxRequestConfig = DbxRequestConfig.newBuilder("recipe-vault")
.withHttpRequestor(OkHttp3Requestor(OkHttp3Requestor.defaultOkHttpClient()))
.build()
private var client: DbxClientV2? = null
/**
* Launches the browser for the user to log in to Dropbox and get the credentials
*/
fun startOAuth2Authentication() {
Auth.startOAuth2PKCE(
context, API_KEY, config,
listOf("account_info.read", "files.content.write", "files.content.read")
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment