You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

donaldp's avatar
donaldp
Collaborator | Level 9
7 years ago

RespondPageWithJSRedirect() - where is this defined?

Hi,

I am trying to set-up a Dropbox connection in .NET (Xamarin to be precise). I am following http://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxOAuth2Helper.htm. When I start typing in "RespondPageWithJSRedirect()" it isn't being detected anywhere by intellisense (Visual Studio 2017). I've got all the usings that have been specified on the quoted page, so I'm either mssing a nuget, or another using, or something like that. When I search for this string on the gitgub page https://github.com/dropbox/dropbox-sdk-dotnet/blob/master/dropbox-sdk-dotnet/Dropbox.Api/DropboxOauth2Helper.cs it only finds 2 instances - a comment and the call itself. Where is this defined? What do I need to add?

 

thanks,

  Donald.

    • donaldp's avatar
      donaldp
      Collaborator | Level 9

      Hi Greg,

       

         Thanks for that. Sorry for slow response, but was away for Xmas, and now spent a while trying to get it working before replying. Making progress, but stuck now (and not getting as far as the RespondPageWithJSRedirect() code to see if that works unfortunately :-( ).

       

      On Win10 I get as far as the System.Diagnostics.Process.Start(authorizeUri.ToString()); line, and get Exception thrown: 'System.ComponentModel.Win32Exception' in System.Diagnostics.Process.dll (Googling this not proving very helpful).

       

      Tried on my Android phone when I got stuck on Windows, and only got to the previous line - http.Start(); - though I'm not sure what the problem is as Android throws out an awful lot of messages and I'm not sure what it is I'm looking for there?

      BTW I'm still not sure I have the redirectUri set-up correctly (and could be the problem to begin with here) - responses here always amount to "you can put whatever you want there", which isn't helpful if you don't know what to put there to begin with! I'm using this (as per the code on your page)...

       

      private const string LoopbackHost = "http://127.0.0.1:52475/";
      private readonly Uri RedirectUri = new Uri(LoopbackHost + "authorize");
      private readonly Uri JSRedirectUri = new Uri(LoopbackHost + "token");

       

      So on Dropbox in the redirectUri, should that be "http://127.0.0.1/authorize", or "http://127.0.0.1:52475" or "http://127.0.0.1:52475/authorize", or...? I'm also not sure how to check on unused ports if it comes to that (I found a command, but the command doesn't say whether it's listing used or unused ports! And I don't know if the above message is because that port is busy or something else).

       

      thanks,

        Donald.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Are you getting that error when trying to run the "SimpleTest" sample app? Have you made any modifications (other than plugging in an app key)? I just tried it in Visual Studio 2017 on Windows 10 and I didn't get that error unfortunately. Is there any other output in the log?

        To clarify, are you also trying to run the "SimpleTest" on Android? That sample wasn't written for Android, nor does the .NET SDK itself officially support Android.

        Based on that code snippet, the redirect URI would be "http://127.0.0.1:52475/authorize".

        I can't offer insight on checking the ports on a system though, as that's not part of Dropbox.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

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!