Android Code Snippet Share Facebook

Discussion in 'Code Snippets' started by MarcoRome, Feb 21, 2015.

  1. MarcoRome

    MarcoRome Expert Licensed User

    Hi all. This is intent to share to Facebook.

    'App ID Facebook
    Dim app_id As String = "1541645*******" ' <--- Here put your ID Facebook
    Dim redirect_uri As String = ""
    Dim name, caption, description, picture, link, all As String

    link = 
    name = 
    "App Barzelletta"
    caption = 
    description = 
    "This is description also long ...we see Lorem ipsum dolor sit amet," & _
    "test link adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus." & _
    "Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec," & _
    "gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo," & _
    "eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy." & _
    "Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat In, nunc. Morbi imperdiet augue quis tellus."

    all = 
    "" & app_id _
    "&link=" & link _
    "&name=" & name _
    "&caption=" & caption _
    "&description=" & description _     
    "&redirect_uri=" & redirect_uri

    Dim i As Intent
        i.Initialize(i.ACTION_VIEW, all)
    "android.intent.extra.TEXT", all)
    This is result smarthphone when you click button "Share to FB":


    and this is result:


    Example in attachment.

    Attached Files:

    f0raster0, Procesor, scsjc and 10 others like this.
  2. asales

    asales Well-Known Member Licensed User

    Hello @MarcoRome.

    How I can post in the Facebook only a image (in File.DirDefaultExternal) using this code?

    Thanks in advance for any tip.
  3. MarcoRome

    MarcoRome Expert Licensed User

    I think yes. But again dont try.
    You can try this online in your browser:

    Code:*****&name=Test&description=Test2&picture=Yourimagine&redirect_uri= redirect_uri=
    where 154165**** is your ID Facebook and Yourimagine is your picture.
    asales likes this.
  4. Wolfgang Trageiser

    Wolfgang Trageiser Member Licensed User


    nice work.
    Why there is no password needed to insert/share in Facebook?
    If i know a facebook-id of my friend - i can push/share something in HIS account (with your code)??
  5. DonManfred

    DonManfred Expert Licensed User

    I guess NO.
    The app uses YOUR Facebook App-ID.
    Your friend probably dont have a App-ID.

    Just my 2cent. I can´t answer this as i do not use the lib and i do not have a Facebook-App-ID.
  6. MarcoRome

    MarcoRome Expert Licensed User

  7. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    And to like it on Facebook
    Thank you
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice