Buen día estoy tratando de usar el permiso user_likes en una aplicacion android,
asi es como implemento la solicitud para traer el json con todos los datos
protected void getLikedPageInfo(LoginResult login_result){
Log.v("facebook","facebook token "+ login_result.getAccessToken().toString());
GraphRequest data_request = GraphRequest.newMeRequest(
login_result.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject json_object, GraphResponse response) {
Log.v("facebook","facebook response "+ response);
try {
JSONArray posts = json_object.getJSONObject("likes").optJSONArray("data");
Log.v("facbook","facebook post "+ posts.toString());
for (int i = 0 ; i < posts.length();i++){
JSONObject post = posts.optJSONObject(i);
String id = post.optString("id");
String category = post.optString("category");
String name = post.optString("name");
int count = post.optInt("like");
Log.v("facebook", "facebook lista: " +"id "+ id+" category "+category+" name "+ name +" count "+ count);
}
} catch (Exception e){
Log.v("facebook","facebook error "+ e.getMessage());
}
}
}
);
Bundle permission_param = new Bundle();
permission_param.putString("fields","likes{id,category,name,location,likes}");
data_request.setParameters(permission_param);
data_request.executeAsync();
}
Pero en el log me dice que viene en null,
D/com.facebook.FacebookSdk: getGraphApiVersion: v3.0 07-09 13:40:49.150 21507-21527/mx.com.omnius.basechat D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=FacebookActivity, firebase_previous_id(_pi)=-3426805310557869296, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-3426805310557869299}]
07-09 13:40:49.493 21507-21532/mx.com.omnius.basechat E/GraphResponse: {HttpStatus: 400, errorCode: 10, subErrorCode: -1, errorType: OAuthException, errorMessage: (#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.}
07-09 13:40:49.503 21507-21507/mx.com.omnius.basechat V/facebook request api: cumpleaños: 03/21/1992
07-09 13:40:49.506 21507-21507/mx.com.omnius.basechat V/facebook: facebook response {Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 10, subErrorCode: -1, errorType: OAuthException, errorMessage: (#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.}}
07-09 13:40:49.522 21507-21507/mx.com.omnius.basechat V/facebook: facebook error Attempt to invoke virtual method 'org.json.JSONObject org.json.JSONObject.getJSONObject(java.lang.String)' on a null object reference
Soy nuevo usando el sdk de facebook, estare pasando mal algún parámetro, les agradeceria mucho si alguien me diera una idea de como hacer que funcione. Gracias.