I need a basic, how-to guide on how to take a picture from MY webpage, click a button and that button action will send a specific image to the user wall, with some text… Can you tell me exactly the steps to do that.
I have read the Facebook developer forum, the FB.ui but everything echo out : error FB.ui is not defined event
here is my code in html file :
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: 'some weird number things like that : ZCWjysg4SYlkg0gZDZD', status: true, cookie: true, xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
and that code in javascript jQuery trigger button:
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
I have absolutely no idea how to do that… and event some code in some site are wrong (errors)
I think here : http://developers.facebook.com/docs/reference/api/post/ it’s the best source of information to know how, but i missing the basic step 1. 2. 3.
From your code, the appId is wrong!! App Id is all digits, specifically 15 digits, in some places it is also called the api key. What you have posted seems like the app secret, which shouldn’t be put in the JS anyway.
To get an app id you have to create an app in the developer app, or visit this link.
Then register the Javascript SDK, you can refer this url.
Then call the FB.ui method, refer this url.
Hope this helps.