Reputation: 95
I have my access token, how do I hard-code it into the app? I am trying to use this but I need 2 tokens(??) on accesstokenpair but there is only one? I am confused, I know you shouldnt hard-code but I am developing the app for personal purpose
AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
AccessTokenPair accessTokenPair = new AccessTokenPair("XXXXXX");
AndroidAuthSession session = AndroidAuthSession(AppKeyPair appKeys, AccessTokenPair accessTokenPair)
mDBApi = new DropboxAPI<AndroidAuthSession>(session);
Upvotes: 1
Views: 809
Reputation: 16940
The code you posted is for the Dropbox Android Core SDK, and the AndroidAuthSession
constructor you're using is meant for OAuth 1 access tokens, but it sounds like you have an OAuth 2 access token.
For reference, the Dropbox API currently supports both OAuth 1 and OAuth 2. Access tokens for OAuth 1 have two pieces (key and secret) and access tokens for OAuth 2 have just one piece.
To get an AndroidAuthSession
using an OAuth 2 access token, you can instead use this constructor, passing in the access token as a string, instead of AccessTokenPair
:
Upvotes: 1