Dropbox Chooser API

Hey Folks,
Still haven’t figured out a way to communicate with Dropbox. Using HTTP request works for Twitter, but Dropbox requires https so you have to use network.request. Network.request is non-blocking so Corona goes along on it’s merry way instead of waiting for acknowledgements from Dropbox. So, I don’t see a way to get Dropbox REST working right now. So, I was very excited to see Dropbox Chooser. It looks like it might work. The only caveat is that if you click on a link in a showWebPopup web page, will it download a file and, if so, where does the file go? I’m hoping that it will download the file and put it in system.Documents or system.Resources directory.

Would appreciate any thoughts on the matter. [import]uid: 104085 topic_id: 37311 reply_id: 67311[/import]

Hi @michael714.

As of build 1050, the new Twitter sample app, has a new oAuth.lua file that uses network.request() to talk to HTTPs. So if you’re running into oAuth not working with Dropbox, perhaps that might help.

Also we’ve released Networking 2.0 (unrelated) in a recent daily build which gives you more ability to control headers being passed back and forth (we can read them now!).

Of course these are all now async calls instead of the blocking http.socket type library calls and I don’t know why you would need to have a blocking call with DropBox (it’s not something I’ve ever looked into). Is there a specific reason that a call back listener won’t work for you? [import]uid: 199310 topic_id: 37311 reply_id: 145600[/import]

Rob,
Thanks for the reply. I’ll look at the new oAuth. If I can get it to work, I’ll be happy. I have not worked with callbacks before, so it’s just difficult to wrap my brain around the concept. Also, it seems like a callback in a library-like module goes against the idea of allowing the module to be independent of the app and re-usable. Pardon my ignorance here.

Is it possible for you to provide an example with regard to the new oAuth? I’d love to see a calling function accessing the oAuth and then oAuth doing a callback.

I just tried pulling the Dropbox Chooser into a webPopup, but when I click on the Dropbox Chooser button, nothing happens. Wasn’t too optimistic about the Chooser, but I was hopeful.

Thanks again for your support. [import]uid: 104085 topic_id: 37311 reply_id: 145614[/import]

I have not worked with callbacks before, so it’s just difficult to wrap my brain around the concept.

In an event driven system like Corona SDK, callbacks are actually easier that other ways of looping and waiting on things. Basically you write a function that has actions you want to do when an event happens, in this case, the request to the server completes and “calls back” to you saying “I’m done, here’s the data.” Once you get used to this idea, it will become second nature and having things block will seem abnormal.

Also, it seems like a callback in a library-like module goes against the idea of allowing the module to be independent of the app and re-usable. Pardon my ignorance here.

Actually, it’s very library like. You make a call and you get back data. Instead of it being returned from the function, it comes back in the way of a call to your code to deal with it.

[import]uid: 199310 topic_id: 37311 reply_id: 145695[/import]

Rob,
I looked at the new oAuth in the Twitter sample app. I can see the callback structure. I’ll give it another shot.
Thanks! [import]uid: 104085 topic_id: 37311 reply_id: 145735[/import]

Hi @michael714.

As of build 1050, the new Twitter sample app, has a new oAuth.lua file that uses network.request() to talk to HTTPs. So if you’re running into oAuth not working with Dropbox, perhaps that might help.

Also we’ve released Networking 2.0 (unrelated) in a recent daily build which gives you more ability to control headers being passed back and forth (we can read them now!).

Of course these are all now async calls instead of the blocking http.socket type library calls and I don’t know why you would need to have a blocking call with DropBox (it’s not something I’ve ever looked into). Is there a specific reason that a call back listener won’t work for you? [import]uid: 199310 topic_id: 37311 reply_id: 145600[/import]

Rob,
Thanks for the reply. I’ll look at the new oAuth. If I can get it to work, I’ll be happy. I have not worked with callbacks before, so it’s just difficult to wrap my brain around the concept. Also, it seems like a callback in a library-like module goes against the idea of allowing the module to be independent of the app and re-usable. Pardon my ignorance here.

Is it possible for you to provide an example with regard to the new oAuth? I’d love to see a calling function accessing the oAuth and then oAuth doing a callback.

I just tried pulling the Dropbox Chooser into a webPopup, but when I click on the Dropbox Chooser button, nothing happens. Wasn’t too optimistic about the Chooser, but I was hopeful.

Thanks again for your support. [import]uid: 104085 topic_id: 37311 reply_id: 145614[/import]

I have not worked with callbacks before, so it’s just difficult to wrap my brain around the concept.

In an event driven system like Corona SDK, callbacks are actually easier that other ways of looping and waiting on things. Basically you write a function that has actions you want to do when an event happens, in this case, the request to the server completes and “calls back” to you saying “I’m done, here’s the data.” Once you get used to this idea, it will become second nature and having things block will seem abnormal.

Also, it seems like a callback in a library-like module goes against the idea of allowing the module to be independent of the app and re-usable. Pardon my ignorance here.

Actually, it’s very library like. You make a call and you get back data. Instead of it being returned from the function, it comes back in the way of a call to your code to deal with it.

[import]uid: 199310 topic_id: 37311 reply_id: 145695[/import]

Rob,
I looked at the new oAuth in the Twitter sample app. I can see the callback structure. I’ll give it another shot.
Thanks! [import]uid: 104085 topic_id: 37311 reply_id: 145735[/import]