Note that there are some explanatory texts on larger screens.

plurals
  1. PODropNet WP 8 integration - Unable to connect
    text
    copied!<p>I have been trying to connect my Windows Phone 8 app to Dropbox using DropNet. Unfortunately with little success. </p> <p>According to the examples and the documentation on the DropNet Git Page I tried two different ways to connect the app the Dropbox:</p> <p>The first was is "classic" solution presented directly on the DropNet Git Page. After getting the RequestToken a internal WebBrowser control is used to navigate to the Dropbox Login Page. However I was not able to get this working. Generating the token and and the request URL is no problem. But the page is not loaded correctly in the WebBrowser control. The control just flickers but does not show any content. The control is working correctly when I navigate to any other page (like google or so). </p> <p>The second solution works pretty much the same. Instead using a WebBrowser control the URL is called directly and thus the build in Browser App is used. This workes without a problem. After the Login is complete the user is redirected to the app using a custom URL Scheme. However I do not know how to proceed after getting back to the app. The request result already contains an access token. Is it still necessary to use GetAccessTokenAsync()? This thows an error saying "Parameter not found: oauth_token"?</p> <p>How to proceed to use Dropbox?</p> <pre><code>// Step 0. Create the Client _client = new DropNetClient("API KEY", "API SECRET"); // Step 1. Get Request Token _client.GetTokenAsync( (userLogin) =&gt; { // Step 2. Authorize App with Dropbox // Version 1 - Using a WebBrowser Control string url = _client.BuildAuthorizeUrl(AuthRedictURI); loginBrowser.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(loginBrowser_LoadCompleted); loginBrowser.Navigate(new Uri(url)); // OR // Version 2 - Calling the URI directly --&gt; Redirect to Browser App --&gt; Use Custom URL Scheme to return to app string url = _client.BuildAuthorizeUrl(DropNet.Authenticators.OAuth2AuthorizationFlow.Token, AuthRedictURI); WebBrowserTask webbbrowser = new WebBrowserTask(); webbbrowser.Uri = new Uri(url); webbbrowser.Show(); }, (error) =&gt; { //Handle error } ); // Continue Connection Version 1 private void loginBrowser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e) { //Check for the callback path here (or just check it against "/1/oauth/authorize") if (e.Uri.AbsolutePath == AuthRedictURI) { //The User has logged in! //Now to convert the Request Token into an Access Token _client.GetAccessTokenAsync( (response) =&gt; { ... }, (error) =&gt; { ... }); } else { //Probably the login page loading, ignore } } // Continue Connection Version 2 // --&gt; Returned to App using custom URL Scheme. The result is contained in // the Query string that is parsed into a IDictionary public void ContinueConnect(IDictionary&lt;string, string&gt; redirectQueryResult) { // Possible Response after successful login //key: access_token, value: 5915K1yPZ6kAAAAAAAAAAeaA9hsRN4PCF-PVmbgKgZTTfDp3quXeu8zBoTUadu6H //key: token_type, value: bearer //key: uid, value: 10651049 if (*Error_Detected = false*) { // How to continue here? _client.GetAccessTokenAsync( (response) =&gt; { ... }, (error) =&gt; { ... }); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload