cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

A blank Redirect URI in a mobile app is hanging the app

A blank Redirect URI in a mobile app is hanging the app

shantimohan
New member | Level 2

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.

1 Reply 1

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?