I had downloaded restFB 2.0.0 for java it was working fine before Facebook scandal. Basically I had to retrieve some traffic information from a page. It was working fine last month but not I'm having this error
Caused by: 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. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review. (code 10, subcode null)
at com.restfb.exception.generator.DefaultFacebookExceptionGenerator$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookExceptionGenerator.java:174)
at com.restfb.exception.generator.DefaultFacebookExceptionGenerator.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookExceptionGenerator.java:59)
at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:987)
at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:909)
at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:871)
at com.restfb.DefaultFacebookClient.fetchObject(DefaultFacebookClient.java:408)
at gis_map.Facebook.getPostFromComplaintsSystem(Facebook.java:217)
here is the code that I've used before to retrieve info from the page
public int getElementMauritiusTrafficAlert() throws ParseException {
FacebookClient fbClient = new DefaultFacebookClient(accessToken);
Page page = fbClient.fetchObject("1368529399900469", Page.class);
Connection<Post> postFeed = fbClient.fetchConnection(page.getId() + "/feed", Post.class, Parameter.with("since", Today));
for (List<Post> postPage : postFeed) {
for (Post aPost : postPage) {
list.add(aPost.getMessage() + "\n" + aPost.getCreatedTime());
}
}
return list.size();
}
I really don't know what is going wrong with this API, my whole application won't start because of this. I tried to comment the function where I've used the api but it is still throwing this error. Any help please !