Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello friends,
I am developing an ASP.NET application. I implemented Facebook JavaScript API in my application, for connect with Facebook and get FB friend list of user. I had done this successfully.
Now, I want to count how many friends are invited by user. Is it possible with facebook API. User can select multiple friends and i want to count how many friends selected and invited by user, Invited friends Id is bonus if We can get.
Please don't forget that facebook changed its Oauth settings for security reasons.
I'm also trying to get ids values after Send Invitation button clicked and page post back to
C#
        if (Request.Form["ids"] != null)
            {
                span1.InnerHtml = "ids";
//put success code here..
            }
            else
            {
                span1.InnerHtml = "oops no id";
            }
          if (Page.PreviousPage != null)
            {
                span1.InnerHtml = "ids";
//put success code here..
            }
            else
            {
                span1.InnerHtml = "oops no id";
            }

but in this case program control always goes to else condition it means after page is post back form return null value.
Is there any way to get ids of invited friends.
Thanks.
Posted
Updated 25-Dec-11 18:09pm
v2
Comments
[no name] 25-Dec-11 0:48am    
Have you tried asking on the Facebook developers forum?
NileshKRathod 26-Dec-11 0:11am    
No, Not yet
but I'll try it..
Thanks for your response.

1 solution

Ok finally I resolve this issue and get invited friends ids.. :)

Just make on change in your .js file where you put your facebook connect javascript code. Use Get or Request Method instead of Post Method in fb:request-form tag.

JavaScript
var fbhtml = "<fb:serverfbml width="\""" width_of_invitation_div="" xmlns:fb="#unknown"><script type=\"text/fbml\"><fb:fbml><fb:request-form action=" + window.location + " method="REQUEST" invite="true" type="" + type_of_fb_request_form + "" hold=" /><br mode="></fb:request-form></fb:fbml></script></fb:serverfbml>"


After invitation send to users selected friends you get ids[] in url.
you can get these ids through query string and split ids by comma(,) and store in array.
Enjoy FBConnect.
 
Share this answer
 
Comments
NileshKRathod 6-Jan-12 4:45am    
Here is some trouble with Facebook API we are facing from 01 jan 2012.
We use FBML(Facebook markup language) for sending invitation to facebook friends(There is no problem in login to facebook from our app.) which is in phase of deprecation by Facebook.
On Jan 1, 2012: FBML will no longer be supported on Platform. June 1, 2012: FBML apps will no longer work. All FBML endpoints are removed. You can find more here:

developers.facebook.com/docs/reference/fbml/

Now the alternative of FBML is FBJS.
If someone already done R&D on these changes and overcome from this problem please share with us. Please remember we use Javascript SDK for facebook API.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900