0

I have a situation like,

To read all my FB albums and its full contents to display it on the web page.But the issue is I don't want to login for this.

Like my Fb albums display on my webpages.

I found the same question here but the solution was not getting.

What i did is Created an app.

require 'facebook/facebook.php';
    $facebook = new Facebook(array(
     'appId'  => FB_APP_ID,
     'secret' => FB_APP_SECRET,
    ));

$access_token = "ccc"; this is from graph explorer 1 hr valid key when i logged in then only get this
echo $url = "https://graph.facebook.com/oauth/access_token?          
    client_id=".FB_APP_ID."&
    client_secret=".FB_APP_SECRET."&
    grant_type=fb_exchange_token&
    fb_exchange_token=".$access_token;
    //echo "sss".$return = file_get_contents($url);
    try {
        $result = $facebook->api('/MyFBACCId/albums',array('access_token' => $access_token));
         echo "<pre/>";
         print_r($result);
    } catch(FacebookApiException $e) {
        $result = $e->getResult();
         //error_log(json_encode($result));
         echo "Error Condition";
         echo "<pre/>";
         print_r(($result));


    }

I am also tried to extent the key expire but it was not working like it returns The access token does not belong to application APP_ID

So my question is Is that Possible to get the album details without login .

I found some example like here , In my account also i given the album with public scope. but when i try with graph explorer it return empty result.

the whole day i stuck with this any help will be appreciate :(

4

1 回答 1

1

阅读Album你需要的

  • 任何有效的访问令牌,如果它是公开的并且属于Page
  • s 权限,user_photo如果它属于一个User
  • s 权限,friends_photo如果它属于 aUser的朋友

来源:https ://developers.facebook.com/docs/reference/api/album/

您的示例适用于页面。这就是为什么您无需任何令牌即可获取专辑信息的原因。

正如文档所解释的,您将需要访问用户相册的权限。获得许可后,会出现一个令牌,这意味着用户可以登录。因此,您无法在未登录的情况下从您的 FB 帐户中读取所有 Facebook 相册。

于 2013-07-02T11:57:46.040 回答