Facebook JavaScript API: Invite facebook friends

This is the JavaScript code to invite facebook friends (Posting message to their wall)


function inviteFBFriend(friend_id,invitation_message){
var opts = {
             message : invitation_message,
             name : 'Hello User',
             description : 'Facebook is great!',
             picture : 'http://www.knowledgeserve.in/images/knowledgeServeLogo.jpg'
    };

FB.api('/'+friend_id+'/feed', 'post', opts , function(response) {
       if (!response || response.error) {
        alert('Error occured');            
       } else {
           alert('Post ID: ' + response.id);
       }
     });


}

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Session timeout interceptor in struts 2