<!-- login in facebook with extended perms -->
<fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream" faces="true"></fb:login-button>
This will use FB extensions to HTML, which must be activated before with an asynchronous initialization of Facebook javascript library (noticed the appId:, and xfbml:true down below
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '117083285001944', 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);
}());
This function uses the FB.UI Api call to publish on your facebook account
function streamPublish(name, description, caption, hrefTitle, hrefLink, userPrompt, thumb, urlThumb){
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: name,
caption: (caption),
description: (description),
href: hrefLink,
media: [{ type: 'image', src: (thumb), href: (urlThumb)}]
},
action_links: [
{ text: hrefTitle, href: hrefLink }
],
user_prompt_message: userPrompt
},
function(response) {
});
}
</script>
No comments:
Post a Comment