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: 

Re: Mix Chooser and SDK

Mix Chooser and SDK

BogdanCojocariu
Explorer | Level 3
Go to solution

Hello,

I am currently working on app (full permission) where I would like to choose a folder and then display the content on a webpage. It is important that it should be constantly looking for changes in that folder, so I am using longPoll endpoint.

My current flow is: Press a button 'Authorize' to get the access_token and then open a Dropbox.Chooser to select a folder. I would like to open the Dropbox Chooser popup after I get the access_token from the API, but Chrome automatically blocks the popups that don't come from a trusted event (as in a click) - same for Dropbox Chooser. From the UX, I don't want to use 2 buttons and I don't want to ask users to allow popups from my domain.

 

Long story short: My settings should contain access_token and folderId by launching the flow with one click.

 

I am stuck between documentation and differenet stack overflow responses but I was not able to implement something similar.

 

Thank you,

Bogdan

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
I see, thanks for elaborating. No, unfortunately I don't have a better solution to offer. The API and the Chooser aren't designed to be used closely together like this, but I'll pass this along as a feature request.

That being the case, you'll need to implement them both separately, or make your own file browser, as you mentioned.

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution
Hi Bogdan, can you elaborate on what you have so far, and what you're stuck on exactly? The full Dropbox API and the Dropbox Chooser for the most part weren't meant to be used together, but you can do technically so (apart from logistical issues like pop-up restrictions which are out of our control unfortunately). If you're asking a way to both process the OAuth app authorization flow and do the Chooser flow from one click, I'm not sure that will be possible, for the reason you mentioned. You should be able to implement them both separately though.

BogdanCojocariu
Explorer | Level 3
Go to solution

Hey Greg, thanks for your answer.

 

I was hoping there is a Dropbox Chooser from the SDK that also includes the Authorization part. (as Google Picker works - select something after you authorize the app)[1].
The complete story of my project consist in two apps. The user story is being able to display the photos you have from a dropbox folder, but this app does not have any user interaction. So in order to read the files from a folder, I need the access_token and the folderId.

There is a different app for that where user logs with getAuthenticationUrl and selects a folder with Dropbox Chooser and then, I pass this config object to the other app. 

I was hoping I could launch both flows (authorization and file picking) together, not separately. 

 

I started my own pseudo-file picker by 'navigating' dynamically with filesListFolder but maybe I am missing something and there is a better solution.

 

Have a wonderful day,

Bogdan

 

[1]: https://developers.google.com/picker/

Greg-DB
Dropbox Staff
Go to solution
I see, thanks for elaborating. No, unfortunately I don't have a better solution to offer. The API and the Chooser aren't designed to be used closely together like this, but I'll pass this along as a feature request.

That being the case, you'll need to implement them both separately, or make your own file browser, as you mentioned.
Need more support?