sromku / android-simple-facebook

[Deprecated] Simple Facebook SDK for Android
Other
878 stars 349 forks source link

PublishPhotoDialogAction is not catching Facebook.Callback events #298

Open leokillemoll opened 9 years ago

leokillemoll commented 9 years ago

I'm trying to catch the events like 'onComplete' or 'onFail' when executing the '.publish' method of a bitmap, but these events are never executed. Debugging I realized that the events 'onError' or 'onComplete' of the Facebook.Callback called at PublishPhotoDialogAction (at executeImpl method specifically) do never execute.

This only happens when I set to True using the 'withDialog' parameter, when it is set to False the events are correctly executed.

The photos I'm uploading are successfully uploaded, but I need to catch these events. Any idea of why this is happening?

I'm using latest Android-Simple-Facebook and the latest Facebook SDK (3.23.0)

The code I'm executing:

BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap bitmap = BitmapFactory.decodeFile(picture, options);

// create Photo instance and add some properties Photo photo = new Photo.Builder() .setImage(bitmap) .setName(name) .build(); //If mUseNativeApp is set to true, no events are executed //mUseNativeApp is set to true if the Native Facebook app is installed. SimpleFacebook.getInstance().publish(photo, mUseNativeApp, new OnPublishListener() {

@Override
public void onException(Throwable throwable) {
    Log.e("ChallengeFacebook", "onException:" + throwable.getMessage());
}

@Override
public void onFail(String reason) {
    Log.e("ChallengeFacebook", "OnFail:" + reason);
}
@Override
public void onThinking() {
    Log.d("ChallengeFacebook", "Thinking....");
}

@Override
public void onComplete(String response) {
    Log.d("ChallengeFacebook", "onComplete:" + response);
}

});

spirosoik commented 9 years ago

:+1: the same problem I am facing too.