haythem souissi
haythem souissi

Reputation: 3273

Facebook share doesn't work correctly

I am trying to share a text containing a link via facebook. My code work perfectly with the facebook messenger application. But not via Facebook app. In Facebook app i am getting a sharing view with an empty edittext. I Don't want to integrate facebook api and give sharing authorisation. I don't want to do that. I think it can be done only via extras and intent.

My sharing code:

private void ShareWebView(){
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_TEXT, mTitle); 
        startActivity(Intent.createChooser(intent, "Share with"));
    } 

Upvotes: 0

Views: 1702

Answers (2)

madlymad
madlymad

Reputation: 6530

Walkaround: If you do not want to implement it using android SDK

and you want to use

private void ShareWebView(){
   Intent intent = new Intent(Intent.ACTION_SEND);
   intent.setType("text/plain");
   intent.putExtra(Intent.EXTRA_TEXT, mTitle); // MUST contain 1 url
   startActivity(Intent.createChooser(intent, "Share with"));
}

make sure that mTitle contains one LINK.

Why to do that: Although the fact that facebook doesn't work properly it grubs the first url or look like url from the mTitle and post-it as share url. It also automatically catch a subtitle and a photo from that url so the post/share is quite acceptable most of the time avoiding long code implementations!

Upvotes: 1

Sporniket
Sporniket

Reputation: 339

You cannot. See Android and Facebook share intent

And especially this link provided in one of the comment : http://developers.facebook.com/bugs/332619626816423

Upvotes: 1

Related Questions