Facebook API error 191

前端 未结 11 2262
面向向阳花
面向向阳花 2020-11-22 10:20

I\'m trying to integrate my project with Facebook. I\'m taking baby steps at first and just trying to login, get a Facebook session, and get some user data. I\'m developing

11条回答
  •  无人共我
    2020-11-22 10:38

    Had the same problem:

    $params = array('redirect_uri' => 'facebook.com/pages/foobar-dev');
    $facebook->getLoginUrl($params);
    

    When I changed the redirect_uri from the devloper page to the live page, 191 Error came up.

    So I deleted the $params:

    $facebook->getLoginUrl();
    

    After the app-request now FB redirects to the app url itself f.e.: my.domain.com

    What I do now is checking in index.php of my app if I'm inside FB iframe or not. If not I redirect to the live FB page f.e.:

    $app = 'facebook.com/pages/foobar-live';
    $rd = (isset($_SERVER['HTTP_REFERER'])) ? parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) : false;
    if ($rd == 'apps.facebook.com' || (!isset($_REQUEST['signed_request'])))  {
        echo '';
        die();
    }
    

提交回复
热议问题