Facebook send message (MessageDialog) is not working

499 Views Asked by At

I am really wasting time on trying to figure out what might be wrong. I have a button(not fb send button) and on click i want to open messenger(or with any other way) to send a message to users. This is my code:

MessageDialog messageDialog = new MessageDialog(thisFragment);

    if (MessageDialog.canShow(ShareLinkContent.class)) {

        ShareLinkContent linkContent = new ShareLinkContent.Builder()
                .setContentUrl(Uri.parse("http://developers.facebook.com/android"))
                .build();

        messageDialog.show(linkContent);
    }else{
        Log.e(TAG, "Can't be shown");
    }

I tried as many code sample as i could find on the internet. The facebook documentation on sharing is really poor.The code always executes the 'else' block on my if statement.

I can show the ShareDialog with the same exact procedure. But MessageDialog is not working and it doens't even logs anything. Is there any way to send a message? Or any source that is tested and working?

Thanks a lot

0

There are 0 best solutions below