I am using Facebook Android SDK version 4.25 and ShareLinkContent, ShareDialog for posting to Facebook on user behalf using my app.
This is the dialog which opens when user clicks my app's share functionality
There are two cross icons in sharedialog as you can see in the image. When i am clicking upper cross icon, sharedialog closes and onCancel callback is called.
Problem is when i am clicking lower cross icon onSuccess callback is being called same when i am clicking Post button. I want to give user some points when he shares post to Facebook. But i am getting success callback on lower cross icon as well. What to do? Thank You.
This is the callback code i am using :-
shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Log.e(LOG_TAG, "Facebook share success " + result.getPostId());
}
@Override
public void onCancel() {
Log.e(LOG_TAG, "Facebook share cancel");
}
@Override
public void onError(FacebookException error) {
Log.e(LOG_TAG, "Facebook share error");
}
});