0

I have implemented Facebook Messenger dialog to post messages. It's working as expected, I am able to show messenger dialog and also post the message.

uiHelper = new UiLifecycleHelper(this, null);
 uiHelper.onCreate(savedInstanceState);

FacebookDialog.MessageDialogBuilder builder = new FacebookDialog.MessageDialogBuilder(
                    this)
                    .setLink("http://programmerguru.com/android-tutorial/getting-started-with-the-facebook-sdk-for-android/")
                    .setName("Android Facebook Social App Tutorial")
                    .setCaption("Build great social apps that engage your friends.")
                    .setPicture("http://programmerguru.com/android-tutorial/wp-content/uploads/2014/10/Facebook_SDK_Thumb.png")
                    .setDescription("Allow your users to message links from your app using the Android SDK.");

....
public 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("Messenger", String.format("Error: %s", error.toString()));
            }

            @Override
            public void onComplete(FacebookDialog.PendingCall pendingCall, Bundle data) {
                Log.i("Messenger","Bundle data "+data); //showing Bundle[EMPTY_PARCEL]  
                Log.i("Messenger",data.getString("completionGesture")); //giving error
            }
        });

But the problem is, I'm not getting any bundle data as example completionGesture. That is why can't check whether the message has been post or cancelled. Some thread are saying I wont be able to get the completion gesture when using the Messenger Dialog unless have authed my app (logged in). So I already have provided login process , but still no luck.

I'm using facebook sdk 3.23 Please help me, how to auth my app properly to get completiongesture. If anyone solve this task please help me providing some code.

Anjan Roy
  • 1
  • 1
  • Sorry to disappoint you, but Facebook have released new version [SDK 4.0](https://developers.facebook.com/docs/android/change-log-4.x), where changed and added a lot of things, including `uiHelper` and messages. – VadymVL Apr 01 '15 at 13:46
  • @VadymVL thanks for commenting. ya, I'm very much aware of that, but for some reason I have to stick to old sdk version 3.23, so any help according to that version would be appreciated. – Anjan Roy Apr 02 '15 at 08:06

0 Answers0