One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
shantimohan
5 years agoNew member | Level 2
A blank Redirect URI in a mobile app is hanging the app
I am using Dropbox.Api NuGet package in a Xamarin Forms app. Though Xamarin is not supported officially, even after 5+ years of its existance, I could, and many like me, implement it successfully for Android and iOS apps using Xamarin.
Your documentation and also as mentioned in several post in this forum I find that Mobile apps don't need to set the Redirect URI in app console and the same need not be supplied while signing in. Am I correct?
I am using the following code in C# while authorizing.
var authorizeUri = DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType.Token, App.DbAppKey, new Uri(App.DbRedirectUri), this.oauth2State);
If I set App.DbRedirectUri = "", then the app hangs using the above code.
So can I get more specific explanation of setting (or not setting) the Redirect URI for mobile apps.
- Greg-DB
Dropbox Staff
Thanks for the post. As you mentioned, Xamarin isn't officially supported for the official Dropbox API v2 .NET SDK, so I can't offer much help with that, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
And by "Mobile apps don't need to set the Redirect URI in app console and the same need not be supplied while signing in" I think you're referring to how the official Dropbox API mobile SDKs (i.e., the official Dropbox API v2 Java SDK for Android, and Swift and Objective-C SDKs for iOS) don't require the app/developer to specify a redirect URI. That's only because these official SDKs have been written specially to implement the app authorization flow for you, and automatically utilize the official Dropbox mobile app, if installed, or the official Dropbox web site, if not.
If you're not using one of those official mobile SDKs though, such as in this case where you're using the .NET SDK, that special pre-built authorization flow doesn't apply. So, I wouldn't expect supplying an empty string as the redirect URI to work. When using the standard OAuth flow like this, the redirect URI should be the actual URI where you want to send the user after they authorize the app, to complete the flow. You can find information on how the OAuth help in the .NET SDK is meant to be used in the documentation here.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,947 PostsLatest Activity: 29 minutes ago
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 or Facebook.
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!