简体   繁体   中英

Is there any way to get feeds from public facebook pages using spring social, restfb, etc

I am trying to get feeds of public facebook pages in my java application. I am using graph api. I keep getting an error. Error listed below.

I have generated the access token several times.

FacebookClient facebookClient = new DefaultFacebookClient("my access token goes here", Version.VERSION_4_0);

User user = facebookClient.fetchObject("me", User.class);
Page page = facebookClient.fetchObject("cocacola", Page.class,
        Parameter.with("fields", "fan_count"));

out.println("User name: " + user.getName());
out.println("Page likes: " + page.getFanCount());

Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: (#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook

Like the error response says to read public page data your app needs to reviewed and approved for Page Public Content Access, you cannot access/read public page data w/o it. See https://developers.facebook.com/docs/apps/review/feature/#reference-PAGES_ACCESS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM