Friday, 17 April 2015

Inviting facebook friends to your website using javascript SDK

Hi guys,

Today I am going to share some interesting news.  Now a days everyone having a website but they dont know how to market it. I am going to share how to send a invitation about your website to your facebook friends.


Here we follow only 5 Steps

Step 1 : you have to create a application in facebook  – https://developers.facebook.com/apps 
Step 2: After creating facebook application – get your facebook app id 
Step 3 : Insert this  sdk before head tag

<script src="http://connect.facebook.net/en_US/all.js"></script>

Step 4 :

Insert this javascript code in your web page

FB.init({
 appId:'your app id', cookie:true, status:true, xfbml:true
 });
function FacebookInviteFriends()
{
FB.ui({ method: 'send',name: 'Complete Web Tutorials - PHP, Mysql, Ajax, Jquery, HTML, CSS, facebook, twitter',link: 'http://w3lessons.info', description: 'your website description', picture: 'http://w3lessons.info/demo/web2.0.jpg'});
}

Step 5: call the facebookinvitefriends function via this link

<a href="#" onclick="FacebookInviteFriends();">Bring Your Friends</a>

thats it man.. you are done!! Finally Message will appear in your friends inbox like this



Referece Website : 
http://w3lessons.info/2012/10/15/inviting-facebook-friends-to-your-website-using-javascript-sdk/

No comments:

Post a Comment