1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with redirect_uri in $facebook->getLoginUrl

Discussion in 'Facebook API' started by ChrisTERiS, Jan 17, 2014.

  1. #1
    Hello,

    I've a problem relevant to redirection after a user authorizes my FB Page Tab Application. While I'm expecting him to be redirect at the FB Page Tab Application, he is redirecting to the site that I've set in my fb application.

    Using the code below:
    
    $params = array(
       scope => 'read_stream,publish_stream,publish_actions,email'
    );
    $facebookconnectlink = $facebook->getLoginUrl($params);    
    
    PHP:
    he is redirecting to the website but the authorization has been validated which means that when he will visit again my FB page he can find his account authorized.

    If I pass as parammeter the redirect_uri with my FB page link, this time he is redirecting to FB page, but without authorization even if gets the dialog boxes and clicks ok on them.

    What I'm doing wrong?

    Thank you
    Chris
     
    ChrisTERiS, Jan 17, 2014 IP
  2. ChrisTERiS

    ChrisTERiS Active Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    66
    #2
    Ok, I solved it. I was adding the Page id in redirect_uri while the correct is the App_id. In a short the correct code is:
    
    $params = array(
        scope => 'read_stream,publish_stream,publish_actions,email',
        redirect_uri => 'https://apps.facebook.com/app_namespace/'
    );
    $facebookconnectlink = $facebook->getLoginUrl($params);  
    
    PHP:
    Ofcourse you need to replace app_namespace with the correct value.
     
    ChrisTERiS, Jan 17, 2014 IP