1

我的 facebook 应用程序在生产环境中不起作用。

在 localhost 上一切正常,但在生产环境中 Facebook 返回“未经授权的 IP 地址”异常。

我使用https://github.com/facebook/php-sdk lib

我的请求:

   $facebook = new App_Facebook(array(
        'appId' => $this->fbAppId,
        'secret' => $this->fbAppSecret,
        'cookie' => true
    ));

    $user = $facebook->getUser();

    $session = $facebook->getSession();


    if (empty($session) || empty($user)) {
        throw new Exception('Error facebook connect');
    }

    try {
        $fbFriends = $facebook->api('/me/friends',array('fields'=>array('name','id')));
    } catch (App_Facebook_ApiException $e) {
        $user = null;
    }

有谁知道它是什么以及如何解决它?

4

1 回答 1

1

Go to https://www.facebook.com/developers/
Click on your app in the "my apps" section on the right
Click "Edit settings"
Click on the "Advanced" section on the left
Check the "security" section. I think you need to modify some the ip whitelist settings

于 2011-06-12T13:24:30.397 回答