How do I integrate the invite multiple friends from facebook to my site -
i want integrate invite friends facebook option how foursquare have implemented it. checked out fb:request form wasn't able run successfully. plus heard theyre deprecating legacy fbml library there better way of doing this?
i'm working in php here.
the facebook requests dialog has replaced it. uses facebook javascript sdk.
full example (click here run on jsfiddle):
<!doctype html> <html> <body> <div id="fb-root"></div> <a href="#" onclick="sendrequests();return false;">invite friends</a> <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({ appid: '**yourappid**', status: true, cookie: true, xfbml : true }); function sendrequests() { fb.ui({method: 'apprequests', message: 'you should learn more awesome site.', data: 'tracking information user'}, function(response) { if (response != null && response.request_ids && response.request_ids.length >0) { for(var = 0; < response.request_ids.length; i++) { alert("invited: " + response.request_ids[i]); } } else { alert('no invitations sent'); } }); } </script> </body> </html>
Comments
Post a Comment