0
votes

I am expecting to implement a work flow like this.

  • Browse facebook Canvas Page URL: http://apps.facebook.com/app_name/
  • Redirect user to app page if user already has allowed facebook app or if not redircting user to following dialog in side facebook (This is what I am need to get)

Need to get this But now I am getting this.

  • Browse facebook Canvas Page URL: http://apps.facebook.com/app_name/
  • Redirect user to app page if user already has allowed facebook app or if not redircting user to following dialog in side facebook( This is what I am getting now) I am getting this-firstI am getting this-then second Pleas can anyone suggest a way to achieve expected authentication workflow rather than I am getting now.

This is js code I am using now for this,

if (response.authResponse) {
                FB.api( '/me', function( info ) {
                    //ENS.fbConnect(0, response.authResponse.accessToken);
                    login( response, info );
                });


            } else{
                //redirctURL= encodeURI('http://apps.facebook.com/app_name');
                redirctURL= encodeURI('http://my_site_url.com');
                top.location.href = "http://www.facebook.com/dialog/oauth?client_id="+fbAppID+"&redirect_uri="+redirctURL+"&scope=offline_access,email,user_birthday,status_update,publish_stream,user_about_me, user_notes";
            }

Above code else part working when user has not authenticating with app according to I mention in my second point.

Actually I need to redirect user back to http://apps.facebook.com/app_name rather than http://my_site_url.com. But when I used http://apps.facebook.com/app_name for "redirctURL", my authentication workflow is giving me following error.

enter image description here Pleas help me to solve fallowing issues which I have described above

  1. Workflow issue
  2. Redirect issue
2
First question: Click here to see this in action: apps.facebook.com/wpsocialreader. I need to implement exactly like this one. But I am getting workflow that I have shown in above. Some time this this because of incorrect app configuration setting. Please help me to solve this issue. second question: I need to get back redirect user to my facebook app section rather than my web site after above authentication process. But when I set facebook app url it is getting an error as I have shown above. Pleas help me to solve above two issue.Ananda Subasinghe

2 Answers

0
votes

So if i understand your questions:

1) You want an auth dialog like the washington post app - You can enable the enhanced auth dialog in the app settings, but unless you also have open graph actions and objects defined (which are part of the beta APIs) it'll be a much smaller dialog because you won't have any timeline units

2) Are you sure you're redirecting to the correct URL? That error usually happens if you try to redirect to a URL other than your app's own URL