multi_friend_selector.php form submission from .net IFRAME app ?

Sep 25, 2007 at 9:32 AM
Edited Sep 25, 2007 at 9:33 AM
Has anyone got this working ? or got an approach they think will work.

Form submission does not work because of how .NET works, you can't use FBML because it is an IFRAME app.

Currently trying httpwebrequest POST from server, but not had success yet.

Any ideas gratefully received.

(We are interfacing an existing .NET multiplayer game engine to FB, so IFRAME is our only choice)>

Regards

KeithT

Sep 25, 2007 at 7:02 PM
Use the URL returned from the method below in the same way you used the URL returned by SendRequest.

Add to FacebookAPI.cs:

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;

Dictionary<string, string> parameterList = new Dictionary<string, string>();
// parameterList.Add("method", "facebook.notifications.sendRequest");
parameterList.Add("content", string.Format(CultureInfo.InstalledUICulture, markup));
parameterList.Add("type", requestType);
parameterList.Add("actiontext", actionText);
parameterList.Add("exclude_ids", excludeList);
parameterList.Add("invite", isInvite.ToString());
// parameterList.Add("image", imageUrl.ToString());
parameterList.Add("action", actionUri.ToString());
parameterList.Add("api_key", _applicationKey);
// parameterList.Add("session_key", _sessionKey);

StringBuilder queryBuilder = new StringBuilder();

parameterList.Add("sig", GenerateSignature(parameterList));

// Build the query
foreach (KeyValuePair<string, string> kvp in parameterList)
{
queryBuilder.Append(kvp.Key);
queryBuilder.Append("=");
queryBuilder.Append(HttpUtility.UrlEncode(kvp.Value));
queryBuilder.Append("&");
}
queryBuilder.Remove(queryBuilder.Length - 1, 1);

return "http://www.facebook.com/multifriendselector.php?" + queryBuilder.ToString();
}

Add to FacebookService.cs;

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;
if (!IsSessionActive() && IsDesktopApplication)
{
ConnectToFacebook();
}

return _facebookAPI.MultiFriendSelector(actionUri, markup, actionText, excludeList, requestType, isInvite);
}
Oct 1, 2007 at 11:25 PM
This should work for you. Not as elegant as I would have liked, but it works for post by using javascript to generate a new form and then filling it with required parameters as hidden fields.

Protected Sub btnInviteFriends_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInviteFriends.Click
'init multifriendselector parameters
Const API_KEY As String = "12345678901234567890123456789012"
Const SECRET As String = "12345678901234567890123456789012"
Const ACTION As String = "http://apps.facebook.com/elevenreps/"
Const ACTION_TEXT As String = "Invite friends to join 11reps"
Const CONTENT As String = "11reps <fb:req-choice url=""http://apps.facebook.com/elevenreps/"" label=""Add 11reps.com"" />"
Const MAX As String = "20"
Const INVITE As String = "true"
Const TYPE As String = "11reps"
'dertermine who already has app
Dim strExcludeIds As String = ""
strExcludeIds = getMembers(API_KEY, SECRET)
'build key for signature
Dim strConcat As String = "action=" & ACTION & "actiontext=" & ACTIONTEXT & "apikey=" & API_KEY & _
"content=" & CONTENT & "exclude_ids=" & strExcludeIds & "invite=" & INVITE & "max=" & MAX & "type=" & TYPE & SECRET
Dim strSig As String = getMd5Hash(strConcat)
'create new post form
Response.Write("<form id=""postForm"" target=""top"" action=""http://www.facebook.com/multifriend_selector.php"" method=""post"">")
Response.Write("</form>")
Dim sb As New System.Text.StringBuilder
'build javascript to insert hidden elements into form
sb.Append("<script language=javascript>")
sb.Append("function setElem(form, name, value) {")
sb.Append("var el = document.createElement(""input"");")
sb.Append("el.type = ""hidden"";")
sb.Append("el.name = name;")
sb.Append("el.value = value;")
sb.Append("form.appendChild(el);")
sb.Append("}")
'insert parameters into form and submit
sb.Append("var myForm = document.forms'postForm';")
sb.Append("setElem(myForm, 'action', '" & ACTION & "');")
sb.Append("setElem(myForm, 'actiontext', '" & ACTION_TEXT & "');")
sb.Append("setElem(myForm, 'apikey', '" & APIKEY & "');")
sb.Append("setElem(myForm, 'content', '" & CONTENT & "');")
sb.Append("setElem(myForm, 'exclude_ids', '" & strExcludeIds & "');")
sb.Append("setElem(myForm, 'invite', '" & INVITE & "');")
sb.Append("setElem(myForm, 'max', '" & MAX & "');")
sb.Append("setElem(myForm, 'type', '" & TYPE & "');")
sb.Append("setElem(myForm, 'sig', '" & strSig & "');")
sb.Append("myForm.submit();")
sb.Append("</script>")
ClientScript.RegisterClientScriptBlock(GetType(String), "addScript", sb.ToString)
sb = Nothing
End Sub

Private Function getMembers(ByVal api_key As String, ByVal secret As String) As String
Dim strExcludeIds As String = ""
Dim _fbService As New Facebook.Components.FacebookService()
fbService.ApplicationKey = apikey
_fbService.Secret = secret
_fbService.IsDesktopApplication = False
fbService.SessionKey = Session("facebooksession_key")
fbService.UserId = Session("facebookuserId")
Try
Dim otherFriends As System.Collections.ObjectModel.Collection(Of Facebook.Entity.User) = _fbService.GetFriendsAppUsers
For Each myFriend As Facebook.Entity.User In otherFriends
strExcludeIds &= myFriend.UserId & ","
Next
If strExcludeIds.Length > 0 Then
strExcludeIds.TrimEnd(",")
End If
Catch ex As Exception
End Try
Return strExcludeIds
End Function

Private Function getMd5Hash(ByVal input As String) As String
'Create a new instance of the MD5CryptoServiceProvider object.
Dim md5Hasher As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create()
'Convert the input string to a byte array and compute the hash.
Dim data As Byte() = md5Hasher.ComputeHash(System.Text.Encoding.Default.GetBytes(input))
'Create a new Stringbuilder to collect the bytes
'and create a string.
Dim sBuilder As System.Text.StringBuilder = New System.Text.StringBuilder()
'Loop through each byte of the hashed data
'and format each one as a hexadecimal string.
For i As Int32 = 0 To data.Length - 1
sBuilder.Append(data(i).ToString("x2"))
Next
'Return the hexadecimal string.
Return sBuilder.ToString()
End Function

Oct 12, 2007 at 12:54 PM
Why can't we just create a whole bunch of hidden inputs boxes and put all the information there? why do we have to go to some much trouble as creating a form using javascript??
Oct 17, 2007 at 9:00 AM
Thanks very much jkennedy for posting this solution, as you say it may not be elegant but it works.

Has anyone got the interpretation of the ids[] that come back in the query string from Facebook working. We are having some trouble with this, request.querystring does not seem to work as a solution.......

Regards

KeithT
Oct 18, 2007 at 2:20 PM

pete_oleary wrote:
Use the URL returned from the method below in the same way you used the URL returned by SendRequest.

Add to FacebookAPI.cs:

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;

Dictionary<string, string> parameterList = new Dictionary<string, string>();
// parameterList.Add("method", "facebook.notifications.sendRequest");
parameterList.Add("content", string.Format(CultureInfo.InstalledUICulture, markup));
parameterList.Add("type", requestType);
parameterList.Add("actiontext", actionText);
parameterList.Add("exclude_ids", excludeList);
parameterList.Add("invite", isInvite.ToString());
// parameterList.Add("image", imageUrl.ToString());
parameterList.Add("action", actionUri.ToString());
parameterList.Add("api_key", _applicationKey);
// parameterList.Add("session_key", _sessionKey);

StringBuilder queryBuilder = new StringBuilder();

parameterList.Add("sig", GenerateSignature(parameterList));

// Build the query
foreach (KeyValuePair<string, string> kvp in parameterList)
{
queryBuilder.Append(kvp.Key);
queryBuilder.Append("=");
queryBuilder.Append(HttpUtility.UrlEncode(kvp.Value));
queryBuilder.Append("&");
}
queryBuilder.Remove(queryBuilder.Length - 1, 1);

return "http://www.facebook.com/multifriendselector.php?" + queryBuilder.ToString();
}

Add to FacebookService.cs;

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;
if (!IsSessionActive() && IsDesktopApplication)
{
ConnectToFacebook();
}

return _facebookAPI.MultiFriendSelector(actionUri, markup, actionText, excludeList, requestType, isInvite);
}


This solution works!!! Thank you very much.
A small correction. The return URL must be multi(underscore)friend(underscore)selector.php (not multifriendselector.php, CodePlex formatter transforms underscore to italic tag)

My code is :

string txt = this.FBService.MultiFriendSelector(new Uri("http://apps.facebook.com/hangidizi/default.aspx"), "'This application does something to your friends. Join me in the Application!' <fb:req-choice url='http://www.facebook.com/add.php?apikey=d43b5479ea3b7cc36f5c2bf479886366' label='Check out the Application!' />", "Add My Application", "", "request", true);

lnkAdd.NavigateUrl = txt;
lnkAdd.Target = "_top";

Thank you for your great contribution!
ilhan

Nov 20, 2007 at 9:50 PM
hi guys,

i have lates release 1.5 and i don't get FBService.MultiFriendSelector.
how would i add code to FacebookService.cs.

thanks,
Dec 22, 2007 at 10:15 PM
How doyou recompile the file system to recreate the facebook.dll?
Dec 28, 2007 at 8:22 PM

jdsu wrote:
How doyou recompile the file system to recreate the facebook.dll?


You do not recompile the file system. You compile solution. 1. Download source code 2. Open in Visual Stuio 3. Change Code. 4. Build Solution 5. Now you will have new .ddl file in BIN direcotry

Jan 10, 2008 at 6:07 PM

ilhanercan wrote:

pete_oleary wrote:
Use the URL returned from the method below in the same way you used the URL returned by SendRequest.

Add to FacebookAPI.cs:

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;

Dictionary<string, string> parameterList = new Dictionary<string, string>();
// parameterList.Add("method", "facebook.notifications.sendRequest");
parameterList.Add("content", string.Format(CultureInfo.InstalledUICulture, markup));
parameterList.Add("type", requestType);
parameterList.Add("actiontext", actionText);
parameterList.Add("exclude_ids", excludeList);
parameterList.Add("invite", isInvite.ToString());
// parameterList.Add("image", imageUrl.ToString());
parameterList.Add("action", actionUri.ToString());
parameterList.Add("api_key", _applicationKey);
// parameterList.Add("session_key", _sessionKey);

StringBuilder queryBuilder = new StringBuilder();

parameterList.Add("sig", GenerateSignature(parameterList));

// Build the query
foreach (KeyValuePair<string, string> kvp in parameterList)
{
queryBuilder.Append(kvp.Key);
queryBuilder.Append("=");
queryBuilder.Append(HttpUtility.UrlEncode(kvp.Value));
queryBuilder.Append("&");
}
queryBuilder.Remove(queryBuilder.Length - 1, 1);

return "http://www.facebook.com/multifriendselector.php?" + queryBuilder.ToString();
}

Add to FacebookService.cs;

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;
if (!IsSessionActive() && IsDesktopApplication)
{
ConnectToFacebook();
}

return _facebookAPI.MultiFriendSelector(actionUri, markup, actionText, excludeList, requestType, isInvite);
}


This solution works!!! Thank you very much.
A small correction. The return URL must be multi(underscore)friend(underscore)selector.php (not multifriendselector.php, CodePlex formatter transforms underscore to italic tag)

My code is :

string txt = this.FBService.MultiFriendSelector(new Uri("http://apps.facebook.com/hangidizi/default.aspx"), "'This application does something to your friends. Join me in the Application!' <fb:req-choice url='http://www.facebook.com/add.php?apikey=d43b5479ea3b7cc36f5c2bf479886366' label='Check out the Application!' />", "Add My Application", "", "request", true);

lnkAdd.NavigateUrl = txt;
lnkAdd.Target = "_top";

Thank you for your great contribution!
ilhan




I got the above solution to send out an invitation to join my application. I set up another account on Facebook to receive the invite. I use the same computer I am developing on to change accounts and go to "http://www.facebook.com/reqs.php#confirm18869288512request" When the invitee clicks on the "Check out the application" button they are just returned to their profile page instead of the application page. Could this be from accesing the application via localhost?
Jan 25, 2008 at 10:56 AM
Edited Jan 25, 2008 at 11:08 AM
Thanks for this code, but its broken :(

I am testing btnInviteFriends_Click

Firefox and IE both 1st gives POPUP warning - then I get 404 error for this link:
http://www.facebook.com/multifriend_selector.php

Any ideas, I use 1.6 dlls but there is no FBService.multiMultiFriendSelector() either..

---PS.
figured out currect URL
http://www.facebook.com/multifriendselector.php

Problem is POPUP warning, how could I bypass it..??

Also the selector page does not appear, this javascript error occurs

Error: uncaught exception: Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLFormElement.submit]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost:51219/facebook_test/test.aspx :: <TOP_LEVEL> :: line 31" data: no
Jan 26, 2008 at 8:12 AM
For those of your using v 1.6 add the following code to the FacebookService.cs file.

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;

if (!IsSessionActive() && IsDesktopApplication)
{
ConnectToFacebook();
}

Dictionary<string, string> parameterList = new Dictionary<string, string>();
// parameterList.Add("method", "facebook.notifications.sendRequest");
parameterList.Add("content", string.Format(CultureInfo.InstalledUICulture, markup));
parameterList.Add("type", requestType);
parameterList.Add("actiontext", actionText);
parameterList.Add("exclude_ids", excludeList);
parameterList.Add("invite", isInvite.ToString());
// parameterList.Add("image", imageUrl.ToString());
parameterList.Add("action", actionUri.ToString());
parameterList.Add("api_key", _applicationKey);
// parameterList.Add("session_key", _sessionKey);
StringBuilder queryBuilder = new StringBuilder();
parameterList.Add("sig", GenerateSignature(parameterDictionaryToList(parameterList)));

// Build the query
foreach (KeyValuePair<string, string> kvp in parameterList)
{
queryBuilder.Append(kvp.Key);
queryBuilder.Append("=");
queryBuilder.Append(HttpUtility.UrlEncode(kvp.Value));
queryBuilder.Append("&");
}
queryBuilder.Remove(queryBuilder.Length - 1, 1);

return "http://www.facebook.com/multifriendselector.php?" + queryBuilder.ToString();
}
Feb 1, 2008 at 11:38 AM
thanks, I am unable to compile the DLL again, is this DLL version (with Multiuser-selector) available for download somewhere?

I have only Visual Web Developer :(
Feb 1, 2008 at 11:05 PM
Edited Feb 1, 2008 at 11:07 PM
I couldn't get the above code to compile either. Here's my version.

I think this should really be included into a main build sometime

public string MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)
{
string results = string.Empty;

if (!IsSessionActive() && IsDesktopApplication)
{
ConnectToFacebook();
}

Dictionary<string, string> parameterList = new Dictionary<string, string>();
// parameterList.Add("method", "facebook.notifications.sendRequest");
parameterList.Add("content", string.Format(CultureInfo.CurrentUICulture, markup));
parameterList.Add("type", requestType);
parameterList.Add("actiontext", actionText);
parameterList.Add("exclude_ids", excludeList);
parameterList.Add("invite", isInvite.ToString());
// parameterList.Add("image", imageUrl.ToString());
parameterList.Add("action", actionUri.ToString());
parameterList.Add("api_key", _facebookAPI.ApplicationKey);
// parameterList.Add("session_key", _sessionKey);
StringBuilder queryBuilder = new StringBuilder();
parameterList.Add("sig", _facebookAPI.GenerateSignature(parameterList));

// Build the query
foreach (KeyValuePair<string, string> kvp in parameterList)
{
queryBuilder.Append(kvp.Key);
queryBuilder.Append("=");
queryBuilder.Append(HttpUtility.UrlEncode(kvp.Value));
queryBuilder.Append("&");
}
queryBuilder.Remove(queryBuilder.Length - 1, 1);

return "http://www.facebook.com/multi_friend_selector.php?" + queryBuilder.ToString();
}
Feb 26, 2008 at 4:39 PM
lnkAdd.NavigateUrl = txt;
lnkAdd.Target = "_top";

what is this lnkAdd ??

Is the link button
Mar 3, 2008 at 3:06 PM
Edited Mar 5, 2008 at 11:06 AM
Hi

I have used the below call to MultiFriendSelector to try get the URL for the multi friend selector

string txt = this.FBService.MultiFriendSelector(new Uri("http://apps.facebook.com/howangry/addfriends.aspx"), "'This appplications allows your friends to rate their anger. Add this application' <fb:req-choice url='http://www.facebook.com/add.php?apikey=c11187909dc7c4f553ec6b6a455e7e36 label='Rate Your Anger!' />", "Add This Application", "", "request", true);

However the requests that are sent out never have the Rate Your Anger button?

Edit: Silly mistake forgot the closing single quote for the url in the fb:req-choice
Mar 3, 2008 at 7:00 PM
Hi,

Excuse me to bother u guys, but i becoming crazy with this C# code.

protected void btnInviteFriends_Click(object sender, System.EventArgs e)

{
//Collection<User> Friends = _fbService.GetFriends();
int Max = 20;
string ExcludeIds = string.Empty;
//We dont' want to invite anyone who is already using the system.
ExcludeIds = GetCurrentMembers();
ArrayList ExcludeIdArray = GetNonMembers(Max);
int i = 0;
string ExcludeIdSet = ExcludeIds;
for (int j = 0; j < ExcludeIdArray.Count; j++)
{
if (!j.Equals(i))
{
ExcludeIdSet += "," + ExcludeIdArrayj;
}
}
AddSetElementJavascript();
CreateInviteForm(ExcludeIdSet, "postFormAll_" + i.ToString());
}
private void AddSetElementJavascript()
{
StringBuilder sb = new StringBuilder();
//build javascript to insert hidden elements into form
sb.Append("<script language=javascript>");
sb.Append("function setElem(form, name, value) {");
sb.Append("var el = document.createElement(\"input\");");
sb.Append("el.type = \"hidden\";");
sb.Append("el.name = name;");
sb.Append("el.value = value;");
sb.Append("form.appendChild(el);");
sb.Append("}");
ClientScript.RegisterClientScriptBlock(this.GetType(), "addScript_SetElement", sb.ToString());
}
protected void CreateInviteForm(string ExcludeIds, string FormName)
{
//init multifriendselector parameters
//Collection<User> Friends = _fbService.GetFriends();
int Max = 20;
//string Action = ConfigurationManager.AppSettings"fbAppLink";
string Action = "http://apps.facebook.com/papakukay_test/";
string ActionText = "Invite friends to view papakukay_test";
//string Content = string.Format("Gifts Registry. <fb:req-choice url=\"{0}\" label=\"papakukay_test\" />", Action);
string Content = string.Format("papakukaytest <fb:req-choice url=\"{0}\" label=\"papakukaytest\" />", Action);
//String Content = "papakukaytest <fb:req-choice url=\""http://apps.facebook.com/papakukaytest/\" label=""Add papakukay_test" />" ;
string Invite = "true";
string Type = "papakukay_test";
//dertermine who already has app
//build key for signature
//string Concat = "action=" + Action + "actiontext=" + ActionText + "api_key=" + _fbService.ApplicationKey +
//"content=" + Content + "exclude_ids=" + ExcludeIds + "invite=" + Invite + "max=" + Max.ToString() + "type=" + Type +
//_fbService.Secret;
string Concat = "action=" + Action + "actiontext=" + ActionText + "api_key=" + "96416f550d428929e72560dcac43e392" +
"content=" + Content + "exclude_ids=" + ExcludeIds + "invite=" + Invite + "max=" + Max.ToString() + "type=" + Type +
"cae93a5964d8562424ccd6a3d438e568";
string Sig = getMd5Hash(Concat);
//create new post form


Response.Write("<form id=\"" + FormName + "\" target=\"top\" action=\"http://www.facebook.com/multifriend_selector.php\" method=\"post\">");
Response.Write("</form>");
StringBuilder sb = new StringBuilder();
//insert parameters into form and submit
sb.Append("<script language=javascript>");
sb.Append("var myForm_" + FormName + " = document.forms'" + FormName + "';");
sb.Append("setElem(myForm_" + FormName + ", 'action', '" + Action + "');");
sb.Append("setElem(myForm_" + FormName + ", 'actiontext', '" + ActionText + "');");
sb.Append("setElem(myForm" + FormName + ", 'apikey', '" + "96416f550d428929e72560dcac43e392" + "');");
//sb.Append("setElem(myForm" + FormName + ", 'apikey', '" + _fbService.ApplicationKey + "');");
sb.Append("setElem(myForm_" + FormName + ", 'content', '" + Content + "');");
sb.Append("setElem(myForm" + FormName + ", 'excludeids', '" + ExcludeIds + "');");
sb.Append("setElem(myForm_" + FormName + ", 'invite', '" + Invite + "');");
sb.Append("setElem(myForm_" + FormName + ", 'max', '" + Max.ToString() + "');");
sb.Append("setElem(myForm_" + FormName + ", 'type', '" + Type + "');");
sb.Append("setElem(myForm_" + FormName + ", 'sig', '" + Sig + "');");
sb.Append("myForm_" + FormName + ".submit();");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "addScript_" + FormName, sb.ToString());
sb = null;
}
private string GetCurrentMembers()
{
string ExcludeIds = string.Empty;
try
{
System.Collections.ObjectModel.Collection<Facebook.Entity.User> AppFriends = _fbService.GetFriendsAppUsers();
foreach (Facebook.Entity.User myFriend in AppFriends)
{
ExcludeIds += myFriend.UserId + ",";
}
if (ExcludeIds.Length > 0)
{
ExcludeIds.TrimEnd(',');
}
}
catch { }
return ExcludeIds;
}
private ArrayList GetNonMembers(int GroupSize)
{
string IncludeIds = string.Empty;
ArrayList IncludeIdList = new ArrayList();
try
{
int CurrentCount = 0;
System.Collections.ObjectModel.Collection<Facebook.Entity.User> NonAppFriends = _fbService.GetFriendsNonAppUsers();
foreach (Facebook.Entity.User myFriend in NonAppFriends)
{
IncludeIds += myFriend.UserId + ",";
CurrentCount++;
if (CurrentCount.Equals(20))
{
IncludeIds.TrimEnd(',');
IncludeIdList.Add(IncludeIds);
IncludeIds = string.Empty;
CurrentCount = 0;
}
}
if (IncludeIds.Length > 0)
{
IncludeIds.TrimEnd(',');
IncludeIdList.Add(IncludeIds);
}
}
catch { }
return IncludeIdList;
}
private string getMd5Hash(string Input)
{
//Create a new instance of the MD5CryptoServiceProvider object.
System.Security.Cryptography.MD5 md5Hasher = System.Security.Cryptography.MD5.Create();
//Convert the input string to a byte array and compute the hash.
Byte[] data = md5Hasher.ComputeHash(System.Text.Encoding.Default.GetBytes(Input));
//Create a new Stringbuilder to collect the bytes
//and create a string.
StringBuilder sBuilder = new System.Text.StringBuilder();
//Loop through each byte of the hashed data
//and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(datai.ToString("x2"));
}
//Return the hexadecimal string.
return sBuilder.ToString();
}

When I click on the button, the default.aspx reload with the authentification error from IE. I never manage to get the multi-selector form too.
I try to deal with the IE error with a session.abandon() and the protected override void OnPreRender(EventArgs e) (don't know exactly how to use it..).

If someone has a idea :)

thanks.
Mar 5, 2008 at 12:39 PM
Edited Mar 5, 2008 at 12:40 PM
Hi

I've created the invite friend page, my method is creating the below URL. When navigating to this URL I am correctly sent to the page and am able to invite friends. However when one of my friends (also developers of the application) tries to add the application they are not sent to the application about page but instead are sent to facebook home page.

I read in the wiki for facebook that this could be a problem with the parameters, below is the URL. Does anyone know how I can debug this? I am the developer of the applicatio but still no error message is shown to me.

http://www.facebook.com/multi_friend_selector.php?content=This+appplications+allows+your+friends+to+rate+their+anger.++Add+this+application+%3cfb%3areq-choice+url%3d'http%3a%2f%2fwww.facebook.com%2fadd.php%3fapikey%3dc11187909dc7c4f553ec6b6a455e7e36'+label%3d'Rate+Your+Anger!'+%2f%3e&type=request&actiontext=Add+This+Application&exclude_ids=&invite=True&action=http%3a%2f%2fapps.facebook.com%2fhowangry%2frant.aspx&api_key=c11187909dc7c4f553ec6b6a455e7e36&sig=ddb0c6e8dfdf67e3bc1fdcdfe055ac07

Any help will be much appreciated.

Thanks
Mar 5, 2008 at 3:21 PM
Edited Mar 5, 2008 at 4:48 PM
have you checked your post-add url in your app settings? might be worth a look
Mar 5, 2008 at 4:26 PM
Hi Zeus

There is no on-add url in app settings only post-add and post-remove.

What is strange is if I use this FBML string

<fb:req-choice url='http://www.facebook.com/apps/application.php?id=8212573562' label='Rate Your Anger!' />

it works and the user is sent to the applications about page, however with this one:

<fb:req-choice url='http://www.facebook.com/add.php?apikey=c11187909dc7c4f553ec6b6a455e7e36' label='Rate Your Anger!' />

the friend is sent to their facebook home page

Mar 5, 2008 at 4:46 PM
Edited Mar 5, 2008 at 4:47 PM
Hi, sorry, I meant post-add, not on-add :)
that'll be where your user is taken after adding the app.
Mar 5, 2008 at 5:05 PM
Yup the post-add url is set (goes to the canvas pages). Problem is the app is never added.
Mar 5, 2008 at 5:30 PM
Edited Mar 5, 2008 at 5:30 PM
Try

<fb:req-choice url='http://www.facebook.com/add.php?apikey=API_KEY&next=NEXT_URL' label='Rate Your Anger!' />

where NEXT_URL is where you want the user to end up post-add. e.g.:

"/add.php?apikey=API_KEY&next=http://www.apps.facebook.com/YOURAPP/"

if that doesnt work, check the syntax in the FBML wiki, I think I have it right.
Mar 23, 2008 at 6:02 AM
Hi Guys,

I was able to use the Invite friends using Envy's solution of MultiFriendSelector(Uri actionUri, string markup, string actionText, string excludeList, string requestType, bool isInvite)

How do i include this page so that i can show the Menu of my page. Right now it takes away the menu of the page and takes me to the invite friend php page.

I know there is a solution since i have seen some apps on facebook like Quick n Easy has done so.

Amit
Mar 25, 2008 at 1:26 AM

I know there is a solution since i have seen some apps on facebook like Quick n Easy has done so.
Is Quick n Easy a FBML or Iframe App?
Mar 25, 2008 at 2:06 AM
From what i can tell they are using .net since they are using .aspx pages. Also it seems a IFrame application but i can be wrong because they are using FBML Force MODE=false in the link.
Mar 25, 2008 at 2:31 AM
I couldn't find it, do you have a link?
Mar 28, 2008 at 12:24 AM
Tiradentes here is the link

http://apps.facebook.com/quickneasy/Default.aspx?fbforcemode=fbml
Mar 28, 2008 at 1:56 AM

@kejriwalamit:

The Invite-Page is http://apps.facebook.com/quickneasy/Default2.aspx?fbforcemode=fbml, so it's done with fbml.

Ueli
Apr 27, 2008 at 6:18 AM
I am quite newbie and this post is confusing. Any simple way of creating an invite page? can you please help, I am under pressure for time!
Thank you so much.