We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
mazinncr9
8 years agoNew member | Level 2
Xamarin Forms DropBox Api v2 C# Redirect Uri for iOS and Android
I used Dropbox api and successfulley got the token and and uploaded and download to and from Dropbox from both iOS and Android. Where my problem arise when the user gives app permission to dropbox there appears a code that has to be copy pasted by the user which is then used to get the access token. Recently I found some apps fetching that code automatically to app .Help me doing it and I have no idea about the redirect Uri
3 Replies
- Greg-DB8 years ago
Dropbox Community Moderator
It sounds like you're currently using the OAuth 2 "code" flow without a redirect URI, so that the user needs to copy and paste the authorization code into your app to complete the app authorization flow.
It is possible to streamline this by using a "redirect URI", so that the authorization code (or access token, for the "token" flow) is automatically passed to your app. To do this, you should specify the 'redirect_uri' in the /oauth2/authorize URL. You can find more information on using this in the documentation for /oauth2/authorize. I also recommend reading the OAuth Guide, if you haven't already.
We also recommend using one of the official SDKs, if possible, as they'll do most of the work for you. For instance, the SimpleBlogDemo example app for the .NET SDK has an example of using a redirect URI with the OAuth app authorization flow.
We don't have an official SDK for Xamarin though, so this may require some more work to do this in Xamarin on iOS/Android. For native clients like that, you can use a custom local URL scheme for your redirect URI.
- mazinncr918 years agoNew member | Level 2
Thanks for the response. Yeah you are right. I used it without Redirect Uri .I don't know the Redirect uri of Android and iOS apps. Can you help me to achieve it?
- Greg-DB8 years ago
Dropbox Community Moderator
There isn't a particular redirect URI I can share; the redirect URI is something you would choose and define in your app.
We can't officially support Xamarin, but we recommend using one of the official Dropbox SDKs if possible.
There's an old thread here that may be helpful for doing this in Xamarin though:
https://www.dropboxforum.com/t5/API-Support-Feedback/Dropbox-Xamarin-OAuth-Flow-Question-Retrieving-the-Access-Token/m-p/220537
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!