We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
T3chDad
9 years agoHelpful | Level 6
Android app fails authentication if Dropbox app isn't installed...
Dropbox API/SDK 3.0.5
Android target 19
After verifying there is no saved access token, I'm kicking off the authentication flow with:
Auth.startOAuth2Authentication(getApplicationContext(),...
- 9 years ago
Alright...I figured it out. Silly me. I had two Dropbox activity declarations in my manifest. I had the "old" original entry with my production app key (from v1 days) and I had the new v2 api entry with a different app key that I use for testing. Once I removed the old activity entry and changed the key on the new activity entry, everything worked properly. My Dropbox activities in my manifest as they were before the fix are below for reference.
<!-- Old v1 Activity -->
<activity android:name="com.dropbox.client2.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard"> <intent-filter> <!-- Change this to be db- followed by your app key --> <data android:scheme="db-xxxxxxxxxx(CorrectKey)" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
<!--New v2 Activity --> <activity android:name="com.dropbox.core.android.AuthActivity" android:configChanges="orientation|keyboard" android:launchMode="singleTask"> <intent-filter> <!-- Change this to be db- followed by your app key --> <data android:scheme="db-yyyyyyyyyyyyy(WrongKey)" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>Thanks for your help and patience in getting me pointed in the right direction.
Greg-DB
Dropbox Community Moderator
9 years agoThanks! You shouldn't have to do anything different depending on whether or not the official Dropbox app is installed. They should both use the same flow.
For reference, does the Android sample app display the same issue for you?
Also, I noticed you mentioned that code is in "onReturn". Did you mean "onResume"?
T3chDad
9 years agoHelpful | Level 6
Yes, I meant onResume(). It works with the example app, so I must have broken something by consolidating everything to one activity and class. I'll look into finding the crucial difference and report back when I have it working.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!