Created
March 25, 2017 10:46
-
-
Save rintoug/6a22eb2a20966e4cd895aafdf51ccb48 to your computer and use it in GitHub Desktop.
Share with Facebook, Feed Dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:fb="https://www.facebook.com/2008/fbml"> | |
<head> | |
<title>My Feed Dialog Page</title> | |
</head> | |
<body> | |
<div id='fb-root'></div> | |
<script src='http://connect.facebook.net/en_US/all.js'></script> | |
<p><a onclick='postToFeed(); return false;'>Post to Feed</a></p> | |
<p id='msg'></p> | |
<script> | |
FB.init({appId: "YOUR_APP_ID", status: true, cookie: true}); | |
function postToFeed() { | |
// calling the API ... | |
var obj = { | |
method: 'feed', | |
redirect_uri: 'YOUR URL HERE', | |
link: 'https://developers.facebook.com/docs/reference/dialogs/', | |
picture: 'http://fbrell.com/f8.jpg', | |
name: 'Facebook Dialogs', | |
caption: 'Reference Documentation', | |
description: 'Using Dialogs to interact with people.' | |
}; | |
function callback(response) { | |
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id']; | |
} | |
FB.ui(obj, callback); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment