Facebook : Redirect App From Appcenter to App Page

Normally when you make an apps on facebook and use the method:’apprequests’  of  FB.ui() function to invite friends to join the apps, then the friend gets a notification to join the app which is linked to your apps on facebook app center i.e the url will be like htts://apps.facebook.com/your_apps_namespace where the details of your application or related screen-shots are there.

If you want to redirect your apps from facebook app center to your app’s page then check
$_SERVER[‘HTTP_REFERER’] variable to see if apps.facebook.com is there.

Check this condition like below :

if( parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == "apps.facebook.com")
    //Redirection Code Here

You can redirect using javascript’s top.location.href like below

top.location.href = "facebook.com/YOUR_PAGE_NAME?sk=app_YOUR_APP_ID";

And It's Done!!
Posted in Facebook Apps Development, Facebook Tricks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other followers

%d bloggers like this: