I have added sharing functionality to Android app as described here https://developers.facebook.com/docs/android/share-dialog/#setup
But I have noticed that if user is cancelled sharing activity onComplete
is called anyway
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data, new FacebookDialog.Callback() {
@Override
public void onError(FacebookDialog.PendingCall pendingCall, Exception error, Bundle data) {
Log.e("Activity", String.format("Error: %s", error.toString()));
}
@Override
public void onComplete(FacebookDialog.PendingCall pendingCall, Bundle data) {
Log.e("Activity", "Success!");
}
});
}
I have also looked in to Bundle which is returned. Even if I cancel share dialog I get
com.facebook.platform.extra.DID_COMPLETE=true
How can I get result that user really shared data on facebook? (Without making separate login with facebook button. Maybe some permissions need to be added?)