facebook - Using the FB API, can you share a link, but serve an image that is not on the page -


i can post photo if had time app approved. can share link pulls in photo page. goal post link goes x, image hosted somewhere else.

is possible?

yes, it's possible using javascript sdk , share dialog. example, can following, shares link custom image, name , caption. overwrites og data on page.

function fb_share() {     fb.ui( {         method: 'feed',         name: "facebook api: tracking shares using javascript sdk",         link: "https://www.webniraj.com/2013/05/11/facebook-api-tracking-shares-using-the-javascript-sdk/",         picture: "https://stackexchange.com/users/flair/557969.png",         caption: "tracking facebook shares on website or application useful way of seeing how popular articles readers. in order tracking shares, must used facebook javascript sdk."     }, function( response ) {         // nothing     } );  }  $(document).ready(function(){   $('button.share-btn').on( 'click', fb_share ); }); 

you can same thing in php if have publish_actions permission approved facebook. both produce following result:

enter image description here

source


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -