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
Edmara
8 years agoExplorer | Level 3
TaskCanceledException in call ListFolderAsync("/Image/") with app xamarin portable
Code:
var list = await client.Files.ListFolderAsync("/Image/");
Error:
{System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.Runtime.CompilerServices.Task...
Greg-DB
Dropbox Staff
I can't seem to reproduce this using that code, but a TaskCanceledException can occur of the connection times out. How long does it take before this exception occurs for you? Is there anything that may be interfering with your connection to api.dropboxapi.com?
Edmara
8 years agoExplorer | Level 3
Below is the code, in project ConsoleApplication works perfectly, but cross platform occurs the error.
I would like to know if someone has already used the ListFolderAsync api in poject portable (cross platform) with Xamarin Android?
Code:
private async void OnDownloadListaClicked() { var _accessKey = "<REDACTED>"; using (DropboxClient client = new DropboxClient(_accessKey)) { //this.ListRootFolder(client); try { bool more = true; var list = await client.Files.ListFolderAsync("/Image/"); while (more) { foreach (var item in list.Entries.Where(i => i.IsFile)) { // Process the file } more = list.HasMore; if (more) { list = client.Files.ListFolderContinueAsync(list.Cursor).Result; } } } catch (Exception ex) { // Process the exception } } }
- Greg-DB8 years agoDropbox Staff
I don't know offhand if anyone has used that method in with Xamarin Android. I unfortunately can't offer help with Xamarin in particular, as that's made by a third party. By the way, it looks like Xamarin publishes their own copy of the library, under "Dropbox v2 API for Xamarin" that you may want to try, if you haven't already.
Does it take a long time to fail though? That would indicate a timeout.
Also, I redacted it from your post, but for the sake of security, you should disable that access token. You can do so by revoking access to the app entirely, if the access token is for your account, here:
https://www.dropbox.com/account/security
Or, you can disable just this access token using the API:
HTTP: https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf 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!