cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox Xamarin OAuth Flow Question - Retrieving the Access Token

Dropbox Xamarin OAuth Flow Question - Retrieving the Access Token

NachoMurphy
Explorer | Level 3

Hi there, 

I have a mobile app on Android that uses Xamarin's tools to do some basic dropbox operations. In the past we used the Sync SDK to use dropbox quite easily. With the June v1 shut off coming up, I'm now in the process of updatng the app to use v2 Core API, namely with techniques shown in the Java SDK examples(I've read on these forums that that's the recommended place to learn from for Android).

 

In any case, I'm doing the OAuth flow implementation and have a very similar question to this one: https://www.dropboxforum.com/t5/API-support/Cocoa-WebView-not-reacting-to-quot-Allow-quot-button-cli.... I appear to be close to redirecting back to my app, but I must be doing something wrong.

 

More info:

My app uses the Implicit grant type. I've registered redirect URIs on my apps page at Dropbox developer site(for instance, I have myappname://imagegallery/ as one of them). For the OAth flow, we're assuming that the user doesn't have the official Dropbox mobile app and instead is using an external Android browser(namely Chrome). I'm able to get to the dropbox site just fine to sign in, get to the ALLOW screen but after that I get an unhandled exception in my app. 

 

Here are what my AndroidManifest.xml intent filters looks like, with important values substituted:

<activity android:name="ImageGallery"
  android:configChanges="orientation|keyboard"
  android:launchMode="singleTask">
  <intent-filter>
    <data android:scheme="db-<My_App_Key_Here>"/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>

  <intent-filter>
    <action android:name="android.intent.action.VIEW"></action>
    <data android:scheme="myappname" android:host="imagegallery"></data>
    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>
  </intent-filter>
</activity>

 

I'm expecting the behavior to be as follows: The user signs in & presses the allow button, then the browser switches back to the onResume() of my imagegallery activity. Unfortunately I've been stuck at this point in the auth flow for a day or two. Any advice is much appreciated, thanks.

 

10 Replies 10

NachoMurphy
Explorer | Level 3

Thanks for all your help Greg. I'll be sure to post if I need any help in the future. At this point, I'm going to try a different approach given the circumstances.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    NachoMurphy Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?