Tuesday, 13 December 2022

How to make facebook share button to user facebook application

How can I make a button on my website when someone from a mobile device clicks on the button to share the link via Facebook app NOT via browser ?

This code works for Facebook messenger application.

   $('.messenger').click(function(){
      window.open('fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=' + encodeURIComponent(app_id));
    })

I tried to change the code to the code below but the code below is only opening the Facebook application without insert sharing link

$('.fb-app').click(function(){
  window.open('fb://share?link=' + encodeURIComponent(link) + '&app_id=' + encodeURIComponent(app_id));
})


from How to make facebook share button to user facebook application

No comments:

Post a Comment