0

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"));
    } 
SheetJS
  • 22,470
  • 12
  • 65
  • 75
haythem souissi
  • 3,263
  • 7
  • 50
  • 77
  • Have you implemented [`og:meta` tags](https://developers.facebook.com/docs/opengraphprotocol/) on the URL you are trying to share? – Lix Feb 22 '13 at 10:11
  • i have to implement android sdk for that, i don't want to do that. I just want to share a text via intalled facebook app – haythem souissi Feb 22 '13 at 10:19

2 Answers2

1

You cannot. See Android and Facebook share intent

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

Community
  • 1
  • 1
Sporniket
  • 339
  • 1
  • 4
1

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!

madlymad
  • 6,367
  • 6
  • 37
  • 68