Im using latest Facebook SDK(v4.2.0) for android.
When I tried to post open graph story, logcat says: GraphRequest﹕ Warning: Request without access token missing application ID or client token and story is not being post.
My onCreate method code is:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() {//@Overridden method});
}
And Later I called following code from button's onClickListener
LoginManager.getInstance().logInWithPublishPermissions(this, Arrays.asList("publish_action"));
I have also handled callback as:
@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
}
The code I used for open graph post is:
Bundle params = new Bundle();
params.putString("match", "http://samples.ogp.me/413385652011237");
GraphRequest request = new GraphRequest(
AccessToken.getCurrentAccessToken(),
"me/tigertraptest:complete",
params,
HttpMethod.POST
);
GraphResponse response = request.executeAndWait();
Also I have tried all solution suggested in this link: failed solution.
I'm new to Facebook Integration. Please help.
Edit I have posted all codes that I used in my activity to enable Facebook open graph post.
You need to pass access token also.