Reputation: 9
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
Upvotes: 0
Views: 381
Reputation: 1274
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
Upvotes: 2