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);
       }
     });


}

Comments

Post a Comment

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

How to create mail message in FRC822 format