Have you noticed the new button "Bring Your Friends" just take a quick look at the page position top right. Actually this is Facebook invite friends API system. For implementing this you have to create a Facebook application to setup your webpage canvas URL, just few lines of code but before that your web page should be SSL (https) enable.


Facebook Application
You have to create a Facebook application at developers.facebook.com click here. Here selected text is Facebook app id.

Code
You have to modify appId value.
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'APP_ID',
cookie:true,
status:true,
xfbml:true
});
function FacebookInviteFriends()
{
FB.ui({
method: 'apprequests',
message: 'Your Message diaolog'
});
}
</script>
//HTML Code
<div id="fb-root"></div>
<a href='#' onclick="FacebookInviteFriends();">
Facebook Invite Friends Link
</a>
<script>
FB.init({
appId:'APP_ID',
cookie:true,
status:true,
xfbml:true
});
function FacebookInviteFriends()
{
FB.ui({
method: 'apprequests',
message: 'Your Message diaolog'
});
}
</script>
//HTML Code
<div id="fb-root"></div>
<a href='#' onclick="FacebookInviteFriends();">
Facebook Invite Friends Link
</a>
Facebook invite friends screen.

Code IFrame
The following code is for breaking Iframe, include this code into your webpage.
<script type='text/javascript'>
if (top.location!= self.location)
{
top.location = self.location
}
</script>
if (top.location!= self.location)
{
top.location = self.location
}
</script>
The inivite notification appears like this.

Good article
ReplyDeleteGood article.
ReplyDeleteya very usefulll thanks
ReplyDeletesahi hai bheedooo...;)
ReplyDeletethank u
ReplyDeleteThanks for the script. Worked Perfect.
ReplyDeleteThanks for this tutorial I was looking for it.
ReplyDeleteFantastic post. Thanks :)
ReplyDeleteIs there a select all button?
ReplyDeletehow to select all?
ReplyDeleteThanks,Very useful post
ReplyDeletegood article can u please post about the multiselector one ..
ReplyDeleteusing facebook javascript multi friend selector
Thanks...
ReplyDeleteReleased this script on time as
I am currently doing a project which requires this script
it was really very helpfull.
ReplyDeleteI want to facebook connect.. can you guide me how I can get?? and I have question.. SSL must for facebook connect????
ReplyDeleteWow this is what i am expecting...now i can drive more traffic from fb...thanks for your post...
ReplyDeleteNice Post
ReplyDeleteHey man, this is very cool
ReplyDeleteBookmarked !! nice Job !
ReplyDeletegood tutorial.
ReplyDeleteThis is very useful :)
ReplyDeletethank you Srinivas.
ReplyDeleteThis is good
ReplyDeleteYou missed one thing,
ReplyDeleteThere isn't a "Select All" check-box...
It would make life easier for a USER if he/she wants to INVITE all their friends...
Comes in Handy...
Wowww incredible!!! thank for much
ReplyDeleteGreat tutorial!
ReplyDeleteThanks
nice a millions thanks
ReplyDeleteKeep it Brother
ReplyDeleteYOU ARE A GENIUS. I LOVE YOU
ReplyDeleteExcellent!
ReplyDeleteThanks for share it!
Absolutely Excellent. Thanks for this!
ReplyDeleteThank... and goooooo
ReplyDeletethanks, but how to get the number who accept the invite? and the name list?
ReplyDeletethanks its really useful
ReplyDeleteYou are great. Thanks for the article.
ReplyDeletethanks
ReplyDeleteNice tutorial.. How to get the number of persons that the message sent in the return url ?
ReplyDeletestill a lot is available in facebook sdks
ReplyDeletewhat if I don't want to use javascript side and I prefer to use a server side php script... I mean, from php, launch that dialog request??
ReplyDeletenice article...very helpfull
Very nice
ReplyDeletewow i love that tutorial thanks man
ReplyDeletewaiting for the ssl configuring
ReplyDeletegreat
ReplyDeleteVery important post. Great !!
ReplyDeletegr8 info. I love this...
ReplyDeletethnx for info. but what are the disadvantages of using facebook api for inviting friends?
ReplyDeleteThanks for share this.
ReplyDeleteNice one.
ReplyDeleteBut i don't think people would accept these requests , where farm ville and other shit ville requests make people irritating.
getting error on API_ID of facebook help me
ReplyDeleteHello, well i want to thank you so so much for this code. I actually add it on my website and works so fine. i wait for results and let you know soon. Thanks again!
ReplyDeleteAPI Error Code: 191
ReplyDeleteAPI Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
it cannot reditect to any site or any where pls
ReplyDeletesend invitation to friend then it show in notification and then click on it where to redirect explain this code pls hlp me
ReplyDeletewow
ReplyDeleteCode is very Useful, but can I know the way how to exclude those friends that are already registered on my site
ReplyDeleteGreat website. Lots of helpful information here. I am sending it to some friends and also sharing in delicious. And obviously, thank you in your effort!
ReplyDeleteQuite helpful blog.
ReplyDeleteThose who are facing errors, please make sure that your URL is given properly as App Domains. This will solve errors.
Great post : is this possible to add our fanpage ?
ReplyDeleteThanks for your script.very helpfull.
ReplyDeleteI had implemented your code,but still mysite is showing inside facebook page.
how to redirect it?
Thanks
Please help i got the error
ReplyDelete"An error occurred. Please try later"
Great job.
ReplyDeleteExactly what I am looking for ! Thanks
ReplyDeleteVery Helpful I like very much
ReplyDeleteThanks
Hi,
ReplyDeleteI downloaded source code.I given activated appid,but for me showing following error,
An error occurred. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Please help me...
Thanks,
Prasad.
Working on localhost, not on a domain, but within my Facebook app settings I've set a different, existing website. I keep getting this error:
ReplyDeleteAPI Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
In the firebug console I get this:
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
Does this mean this will not work on localhost?
good one thank you....
ReplyDeletenice code thanks for sharing
ReplyDeletethanks for this nice tutorial
ReplyDeleteAwesome, seamlessly integrated into my site :)
ReplyDeleteThank you Srinivas
Thank you so much for this artcile. It helps me alot
ReplyDeleteHow do you get the blue image to appear over the dialog?
ReplyDeleteAPI Error Code: 191
ReplyDeleteAPI Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Great Tutorial...But it should stay on page after click on submit button or it should display that invitation sent successfully and all, currently inviter window get disappeared when we invite
ReplyDeleteHow do you do it so you dont need a pop up window? Ive noticed sites like quora... when you login, they will show a list of friends to invite right on the page.
ReplyDeleteThanks for script...
ReplyDeleteI need you help with the Invite Friends API How I can to do to redirect an aplication when a friend accept the application it's lik = http://apps.facebook.com/lae_espana_icte_uq but I want to redirect = fan page application
Nice Article...Thanks!
ReplyDeletehi
ReplyDeletethat code, work with Page Tab?
BR
after sending the invitation, the concerned person is not getting any notification on facebook.
ReplyDeleteIs there any configuration that needs to be done?
Hi,
ReplyDeleteI have fellow this tutorial but none of my selected friends get a notification...
Does anyone get also this issue ?
good code, very useful... big thanks.
ReplyDeleteNICE POST
ReplyDeleteNice Article. Thanks
ReplyDeleteThank you so much :)
ReplyDeletehow to select all friends?
ReplyDeletenice post.. it hepled me a lot
ReplyDeleteHallo 9lessons.greate artikel,ferry nice.
ReplyDeleteCan you help me. My qustion is.how to redrirect to another web page after user invite their friends.like a Thanks Page.
sorry about my english....!.Thnks :)
Hallo 9lessons, actually i am using the same code in grails Application, so fine the pop is coming with my friend list,and when i select one of my friend and click on send button request is send but the notification is not coming in friends wall, i did all configuration very well, so can you just more elaborate how it will work for mine.i am very glade if you give me a response
ReplyDeleteGreat!
ReplyDeleteThanks!
its very helpfull.. thnx
ReplyDeletenice post. Thanks
ReplyDeleteAdam
For those who has not received the notification try to disable sandbox mod for the app. I had the same problem, but after the sandbox mode was disabled the notification appears on friends wall
ReplyDeleteFacebook is note redirecting to me
ReplyDeleteWill this trigger a mail to friend's email.
ReplyDeleteI want to offer scheme as a gift after 100 like as per invited from particular one user reference
ReplyDeleteSmall base Affiliation System for tracking there inviting user is proceed or not cross 100 like
Any body have Idea?
When you receive a friend's request, it simply redirects to your website instead of facebook app / canvas page....
ReplyDeletePlease specify what trick did you use for that
Very helpful application for me, thank's for sharing
ReplyDeletevery good tutorial, i enjoy it, bookmarked already !
ReplyDeleteAPI Error Code: 191
ReplyDeleteAPI Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
can u please explain me about this error???
thank you very much ,i tried a lot of way but it works fine thank .
ReplyDeleteWhen you receive a friend's request, it simply redirects to your website instead of facebook app / canvas page....
ReplyDeletePlease specify what trick did you use for that
hello... Can you say how can I change text 'Preview of request'?
ReplyDeletehello everyone i am able to open the request pop up but the invitations are not coming to the accounts
ReplyDeleteCannot send notifications to a user who has not installed the app
ReplyDeleteI am able to send apprequest and these are displaying at apprequest section but there is no notification like in your case.
ReplyDelete@Sam have you got how to do what you were asking in above comment.
ReplyDeleteUsing Fb.ui method apprequests for website app is the violation of Facebook policy. It is allowed for games, andriod and IOS app only.
ReplyDeletehttps://developers.facebook.com/docs/reference/dialogs/requests/
hi. why i do same example but when click notification it not redirect to my homepage
ReplyDeleteHi! It seemed to work well until i realized nobody can receive any of those notification? How come? Thanks
ReplyDeletevery good article, but when u say Code IFrame and say to add these code in iframe, what does it mean? where do i have to put these cose? i need this answer, thank you very much!
ReplyDeletei get " Method Not Allowed Error 405 " How can i redirect from canvas to website?
ReplyDeleteI have received any notification. could you please tell me exact reason behind that?
ReplyDeletei have used this code but my friend don't received any notification, what is the problem ? please help me using this
ReplyDeletelike above users.. my friend does not receive any notification while the demo version works..
ReplyDeleteI am having the same issue that arouse with "farrukh farid" can you please guide us to solve this out......
ReplyDeletevery nice.
ReplyDeleteIs there any way to get back info of how many or which friends were invited?
Hi i am not using app but using fb sdk for sending request to invite friend but it not shown in notification tab in facebook instead of post is there. so what can i do for notification.
ReplyDeleteplz give me reply asap....
thanks in advance.
Hi!
ReplyDeleteI tried to do this procedure, but I not found this option: basic info under the settings option.
Could you help with more details, please?
Hello
ReplyDeleteI have implemented same and its working. Notifications displays on friends page but my problem is when click on notification not redirecting to My URL.
Please help me on this.
I have Given Both Canvas URL and everything you have mention but still not redirecting on my URL.
Thanks in Advance.
when click on notification the requested page not redirected..
ReplyDeletewhat's the problem behind that?pls help
Nice Article. Thanks .essay writers
ReplyDeletePlease help me.
ReplyDeleteActually when i have send invitation then the receiver not getting any notification.
What will i do...?
i have created this app and use this same code for my website and it works fine.but the receivers to those who receives notification on thier wall cannot get redirected to my website given as canvas url in app while click on notification.
ReplyDeletewhat is that problem.any help will be greatly appreciated.
i have send invitation then the receiver not getting any notification.
ReplyDeleteHello,
ReplyDeletei have send invitation then the receiver not getting any notification.
what should i do
please help
very good tips and tutorial
ReplyDeletehi notifications not received ,but invite successfull,please help me very urgent
ReplyDeletehi notifications not received ,but invite successfull,please help me very urgent
ReplyDeleteHI
ReplyDeleteI am using same code with my api key n all its work but when i send invite to my friends no notification going
Great tutorial, thank you! But like a few others my invites don't reach Facebook. They seem to send but don't. Is there a problem with app approval, or should what you explained just work without any more set up?
ReplyDeleteMany Thanks.
Got the invite working but now all i does is invite people to try the app. It didn't do this the first few times, very strange, something in my app set up? Any suggestions welcome, thanks
ReplyDeleteThis works great in woindows but was unable to see the notifications in IOS and android
ReplyDeleteCan any one please explain me about this
thanks in advance
My friend can't get my invitation.
ReplyDeleteConfirm, it didn't work in fresh api.
ReplyDeleteGreat tutorial...
ReplyDeletei have a question. is there any way to change notification message which is now like 'Sent you request in a (app name)'. i want to add custom message here with a url. is it possible ? if yes then how ? can you please guide ?
those not getting notification simply do
ReplyDeleteGo to your app->setting->add platform->App on Facebook. Then fill-up Canvas URL and Secure Canvas URL. And then invite you friends again and enjoy.
I am sending requests, but no notification received at the other end.
ReplyDeleteFor all users facing problem like invitation not received,this script work only if you have created proper "facebook canvas" in facebook app.So if you are using this code to invite to your website,you have to create "facebook canvas" and put https url.Note that in this page(https url) you have to write "javascript url redirection code" which will redirect to your website.
ReplyDeleteI am getting the error when tried to use the above code
ReplyDelete"Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."
please help me
Hi !
ReplyDeleteIs this link goes to your web page or your facebook page ?
Thanks
Why am i not getting the invite dialog box, if I'm already logged into facebook ?
ReplyDeleteIt works only if i'm not logged in. anyone else faced this problem ?
I tried this code and it works for me in my older apps. But it is not working on the latest version of app and shows an error like game URL is needed for the app
ReplyDeleteafter disabling sandbox mode i am still not geting notefication
ReplyDeletehi... i tried to create fb app and run... im getting "Game Requests are only available to games." error... could u pls let us know how to create app in right way... the screen shots in this tutorial is old way of creating app... could u help us to do it in new way
ReplyDeleteI have added the "facebook canvas" for app, But no notification in mobile. Please let me know the solutions for this problem.
ReplyDeleteThanks
does this also works with Facebook API 2.5?
ReplyDeleteMy FB app works fine for login, like, share. But still this doesn't work. The fb window appears, you may select your friends and click Done. But the invitations wont go to the friends notifications. Can someone help us?
ReplyDeletecan we send the custom app request notification to my friends?
ReplyDeletecan we send the custom notification to my friends
ReplyDeleteMy friends unable to receive notifications.
ReplyDeleteInvitations wont go to the friends notifications.Please check it..
ReplyDeletenot work for me, the windown pop up view but only loading
ReplyDeleteHey First of all thank you very much for a great tutorial.
ReplyDeleteI am using the same code as you mention above, but when i trying to get the friends list it returns me "You app must be game category " like. so Please could you help me out. I don't want to use send-dailog for inviting friends. Is there any other way to render friends for inviting for my website registration.
Thank you very much.
Thanks for sharing the information
ReplyDelete