Reputation: 159
I am using Facebook graph api
page_id/feed. I successfully got post response but my problem is the post I shared showing over visitor post on Facebook page on which I am posting. I used manage_pages permission to get page_id of users pages.
new GraphRequest( AccessToken.getCurrentAccessToken(),
"/" + page_id + "/feed",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
Log.d(TAG, "" + response.toString());
try {
JSONObject jsonObject = new JSONObject(response.getRawResponse());
if (jsonObject != null) {
String postId = jsonObject.getString("id");
if (postId != null && !postId.equalsIgnoreCase("")) {
hideProgressDialog();
Log.d("postId", "" + postId);
} else {
hideProgressDialog();
Utils.showToast(getActivity(), getResources().getString(R.string.txt_try_again));
}
} else {
hideProgressDialog();
Utils.showToast(getActivity(), getResources().getString(R.string.txt_try_again));
}
} catch (JSONException e) {
hideProgressDialog();
e.printStackTrace();
} catch (Throwable e) {
hideProgressDialog();
e.printStackTrace();
}
}
}).executeAsync();
Upvotes: 1
Views: 38
Reputation: 1182
Please use Page Access Token .Currently you are using User Access Token.
Upvotes: 2