karthik / rdrop2

Dropbox Interface from R
Other
251 stars 59 forks source link

oauth_listener() needs an interactive environment #64

Open detomas83 opened 7 years ago

detomas83 commented 7 years ago

I built a Shiny application with an action button which downloads pdfs hosted in a Dropbox folder. It uses:

drop_media(): to generate the link to download the specific pdf file
browseURL(): to access the generated link

It works perfectly on my computer. However, when I publish it, the download function does not work and I get the following message: Disconnected from the server. Reload.

Looking at the log file, it throws the following error: Warning: Error in : oauth_listener() needs an interactive environment.

I´m a beginner on this type of applications. The Dropbox token is placed on the main directory, and published with the rest of the files.

The application connects successfully to the Dropbox folder in other parts of the code(global.r, server.r), but where it gets stucked is in this one:

fndownload=eventReactive(input$downloadpdf,{
    urr=drop_media("example.pdf", dtoken=token)
    urr$url
})

observeEvent(input$downloadpdf, {
    browseURL(fndownload())
})

Originnaly, the fndownload function was within the obserEvent but I got the same error as well.

There is not much information regarding remote storage Dropbox Shiny applications, but quite few threads regarding the same issue with other remote storage platforms (e.g. gsheets).

Any help will be awesome. Regards

ClaytonJY commented 7 years ago

I haven't tried something quite like this myself, but I notice this in the docs for drop_media:

This URL should not be used to display content directly in the browser

I don't know enough about the Dropbox API to know why that is. Would be happy to help more if you could provide a reproducible example.

karthik commented 7 years ago

Thanks @detomas83 and @ClaytonJY. I'll add this to my list of bugs to check as I'm upgrading to the new API.