In the local environment, I used the below per your suggestion and this works fine
library(httr)
app <- oauth_app('facebook', appID, appsecret)
Sys.setenv("HTTR_SERVER_PORT" = "1410/")
fb_oauth <- oauth2.0_token(
oauth_endpoints('facebook'), app, scope = 'ads_management',
type = 'application/x-www-form-urlencoded', cache = FALSE)
save(fb_oauth, file="fb_oauth")
load("fb_oauth")
tkn <- fb_oauth$credentials$access_token
fbname <- getUsers("me", token=tkn)
updateStatus("Hello World", token=tkn, link = "www.shinyapps.io")
Now in shinyapps.io I used the following:
load("fb_oauth")
tkn <- fb_oauth$credentials$access_token
fbname <- getUsers("me", token=tkn)
updateStatus(paste("Analysis by ",fbname$name," using www.gocharting.com",sep=""), token=tkn, link = capture)
2 observations when above is executed in shinyapps.io:
1. It posts the link in my facebook timeline even when someone else is logged into facebook in the browser.
2. It only posts once when post button in ui.R is clicked. Subsequent clicks do not post anything onto FB
Please let me know what I may be doing wrong here
SD