New invite dialog by facebook


facebook Facebook recently made a new invite dialog that’s very easy to use. Using simple javascript function you can do it easily.

Checkout this link and click New Invite to see the dialog.

To create this dialog just load the javascript sdk, initiate and call this function

function newInvite(){
     FB.ui({ method: 'apprequests',
          message: 'come on man checkout my application. visit http://thinkdiff.net'});
    }

And in html code just call the function

<a href="#" onclick="newInvite(); return false;">New Invite</a>

fb-new-invite

To know more about facebook application development you can check this article.

Reference:
http://developers.facebook.com/blog/post/453

mahmud ahsan

Love computer programming and write occasional blog post. In my early career I worked mostly on web based application and since 2011, I exclusively working on iPhone and android applications. I work at home, father of a nice kid and husband of a beautiful wife. [My Business | Twitter | Linkedin]

You may also like

35 Comments

  • Moumen
    January 29, 2011 at 8:57 pm

    Thankkkss a looot

  • Julian Mesa
    January 31, 2011 at 8:39 am

    Thank you man !!

  • Joe
    February 9, 2011 at 3:01 am

    Hi, thanks this helped a lot, but I’m having some errors in Internet Explorer, it shows a pop-up and when you send the invitation I get an error from facebook… “Something went wrong”.. can you help me?

    Thanks again!

  • Tyler
    February 14, 2011 at 11:51 am

    have you discovered a way to further customize the new inviter?

  • nachiketa
    March 3, 2011 at 5:31 pm

    Hey man great update, works like a charm!

  • shekhar
    March 11, 2011 at 11:43 am

    Very nice

  • julian
    March 15, 2011 at 8:13 pm

    a lot of thanks this is the best blog everrr!!!

  • fred
    March 22, 2011 at 6:36 pm

    I tried the new method its awesome, i would like to post the form to a php script after selecting friends, please help! i need to store them in the database.

  • via
    March 30, 2011 at 8:56 pm

    thanks a lot for this post.
    now I can make facebook invite dialog box easyliy

  • alejandro
    April 6, 2011 at 2:31 pm

    hi,
    thanks a lot!!

    is there any option to know to how many friends the user invites??
    and, when a invited user clicks on it and came to my site/app there is a parameter i can pass and get later??

    thanks.

    • Malik
      April 12, 2011 at 1:47 pm

      i want this too

      is there any option to know how many friends the user invites??

      Thanks

  • pavel
    April 7, 2011 at 9:55 pm

    Don’t also forget that “These requests must be managed and deleted by the application that created them using the graph API.” (FB Api).

  • Hoan Huynh
    April 13, 2011 at 4:56 pm

    If I have lot of friends, around 1k, is there a way to select all automatically.
    Thank you.

  • lior
    April 22, 2011 at 1:50 pm

    hi,
    Is there a way to invite people to a tab application when i don’t know in witch fan page someone put it ?

    thanks.

  • ercan
    April 22, 2011 at 8:26 pm

    if (isset($_REQUEST[‘ids’])){
    echo “Invitation Successfully Sent”;
    echo ”;
    print_r($_REQUEST);
    echo ”;

    this code doesnt work

    in your demo i can see any invited ids

    could you check it again it is very very important to me coz my application depend on only that code i mean i must get which people invited.

  • Troy
    April 23, 2011 at 8:22 am

    Looking for response to this not working, also.

    if (isset($_REQUEST[‘ids’])){
    echo “Invitation Successfully Sent”;
    echo ”;
    print_r($_REQUEST);
    echo ”;
    this code doesnt work
    in your demo i can see any invited ids
    could you check it again it is very very important to me coz my application depend on only that code i mean i must get which people invited.

  • mert_can2
    April 30, 2011 at 10:27 pm

    hi, how can I add return url in my app.

    I want to make this one:

    example:

    http://www.facebook.com/nazeende?sk=app_202097689823330

    http://apps.facebook.com/nazendedavet/

    • gebc
      August 8, 2011 at 8:26 am

      hi, write me in private, i want to share some codes with you.

  • rebu
    May 8, 2011 at 4:05 am

    Can i use this method on a website that uses fb connect?

  • Jangla
    May 16, 2011 at 5:01 pm

    Do I need to ask for any permissions from a user to pop a requests dialog in an iframe canvas application (even basic perms). According to the docs I shouldn’t have to but when I try, I get an error. Anyone with any direct experience of this, I’d really appreciate confirmation one way or the other.

  • jeffery
    June 7, 2011 at 1:28 pm

    hai there,

    this was a nice tutorial indeed….but i wonder if there is a way to do the following in iframe application

    My Little Dialog
    Do you like my little dialog?

    Yes

    No

    this is working fine in FBML i want the same thing in IFRAME app

    i tried this but giving error

    FB.ui(
    {
    ‘method’: ‘fbml.dialog’,
    ‘display’: ‘dialog’,
    ‘fbml’: ‘Here is some html’,
    ‘width’: 575
    },
    function() {
    alert(‘callback was invoked’);
    }
    );

    any one plz let me know how to do it thanking u all in anticipation….

    • jeffery
      June 7, 2011 at 1:32 pm

      Really sorry my code snippet was actually formatted…

      so heres my question…

      how to popup a simple dailouge box in iframe facebook app

      just like we use fb:dialog tag in FBML APPLICATION

  • hitesh
    June 25, 2011 at 12:50 am

    Can we get freinds list which are invited by user in callback?

    I want to store this user refer which friend in databse.

    Please help me get freinds invited by user.

    Thank you.

    • mahmud ahsan
      mahmud ahsan
      June 27, 2011 at 1:58 pm

      Yeah you can, checkout my latest tutorial or Facebook documentation.

  • Jean-Noël
    August 30, 2011 at 8:33 pm

    Hello !
    Thank you for the tip 🙂
    And sorry for my very bad english…

    The Facebook’s code is working very well but when I try your’s, I get this error :

    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.

    Any idea to resolve this problem ?

    • mahmud ahsan
      mahmud ahsan
      August 30, 2011 at 10:05 pm

      Check the url you used in the application setting and the redirect_url also.

      • Jean-Noël
        August 31, 2011 at 4:35 pm

        Thank you for your advice !

      • Enrique
        September 16, 2011 at 3:18 am

        Hi
        I’m getting the same error… do you mean to check the config.php or the app settings in facebook? thanks

  • Jean-Noël
    August 31, 2011 at 8:26 pm

    If you put this code in an iFrame page, all URLs (with or without SSL) must be the same. Anyway, it seems that you can not use another plugin in XFBML: like, send, etc.

  • Jean-Noël
    August 31, 2011 at 8:32 pm

    There is an another problem : you cannot use it if you are as a page and not a profil.

  • usman
    September 5, 2011 at 6:59 pm

    Admin Can I get your Skype Address.I need to talk to you Please..

  • Daniel
    November 20, 2011 at 6:35 pm

    Hi Mahmud,

    There is currently a problem with the invitation dialog neuvo Facebook. It shows small, difficult to view friends, even holds true for the demos on your site. Have an idea of how to solve it?

    Thank you,
    Sincerely Daniel

    • Daniel
      November 20, 2011 at 6:42 pm

      I think the new Facebook invitation dialog looks good only in IE (my version is 9), but Google Chrome and Firefox problems with the size of the dialogue …

  • Mega Pet
    December 3, 2011 at 1:54 pm

    This code does nothing. I entered this code and it produces no output what so ever. I’m missing something?

    • Sandip
      December 26, 2012 at 5:06 pm

      I tried this code but its not sending the request to my friend, because its
      not showing in my friend request

Comments are closed here.

About Me

Hi I am Mahmud Ahsan. I Love computer programming and write occasional blog post. In my early career I worked mostly on web based application and since 2011, I exclusively working on iPhone and android applications. I work at home, father of a nice kid and husband of a beautiful wife. [My Business | Twitter | Linkedin]

Twitter Feed

Fanpage