tags:

views:

23

answers:

3

I am building a facebook app that has a send to friend feature in it.

Each user is given a specific userkey that identifies them and them alone.

So Person A invites person B.

So when person B gets the invite, when they click ACCEPT, we pass the referrer userkey in the URL… e.g. http://mydomain.com.au/return_user.aspx?referrerkey=iuahsduiahsdfuiha

So when person B has already installed the fb app, the referrerkey variables is passed back to our site, so we can manage the link between the 2 users there.

However if person B hasn’t added the app. And Person B clicks the ACCEPT button on the invites page the user has to be take through the “Allow Access” page, from there, they are directed back to the APP home page, with none of the variables I need. E.g. the referrerkey.

So how can i get this to work for both users that have already added the app and havent added the app?

A: 

The only option I know of is making adding the app and linking with friends two separate processes.

Aaron Harun
A: 

Assuming you're using the PHP facebook SDK and a canvas app, You're probably using require_login() to redirect the user to the auth screen. By default, the auth screen will send the user back to the canvas URL you set in the app settings.

To get around this, pass a GET parameter called "next" with a urlencoded URL as the value. If you're lucky, your version of the facebook SDK may have this code preset but not active. Look for ‘&next=‘ in the Facebook class.

Mike Sherov
A: 

Thanks for getting back to me.

I am using C# and the facebook toolkit.

From inside a request ( using the request-form and multi-friend-selector), i set the Required Choice to include the next variable...

e.g. < fb : req-choice url='<%=GetInviteURL() %>' label='Accept' />

public string GetInviteURL() { string nextURL = ConfigurationManager.AppSettings["facebook_app_url"].ToString() +"return_user.aspx?own="+ Master.Api.Users.GetLoggedInUser().ToString() +"&momentid="+ Convert.ToString(Request.QueryString["momentid"]); return "http://www.facebook.com/login.php?api_key" + Master.Api.Session.ApplicationKey + "&next=" + Server.UrlEncode(nextURL) + "&canvas="; }

However, when a new person goes to the invite, clicks Accept, it takes them through the allow app process, but then redirects the user to the app Canvas page and not the URL in the NEXT parameter?

Darren Clark

related questions