简体   繁体   English

Facebook - 获取页面的照片

[英]Facebook - Get photos of a page

I would lik to display the photos from an album of a fan page (that I own) on my site. 我想在我的网站上显示粉丝页面(我拥有)的相册中的照片。 Only from this fan page, not from the visitors their own page. 只有来自这个粉丝页面,不是来自访问者自己的页面。 So I don't won't to see a permessions dialog when a users surfs to the site. 因此,当用户浏览网站时,我不会看到渗透对话框。

I tried to use the Graph Explorer to generate an Access Token for my App. 我尝试使用Graph Explorer为我的应用程序生成访问令牌。 https://developers.facebook.com/tools/explorer https://developers.facebook.com/tools/explorer

With this acces token, I used this url 有了这个访问令牌,我使用了这个URL

 https://graph.facebook.com/120545691408560/photos?access_token={accessToken} 

This worked very well, I got the photos I wanted. 这非常有效,我得到了我想要的照片。

But when I logged out of Facebook, I've got the following error 但是当我退出Facebook时,我遇到了以下错误

message: "Error validating access token: The session is invalid because the user logged out." 消息:“验证访问令牌时出错:会话无效,因为用户已注销。”

So how do I generate an Acces Token that works when I am not logged in? 那么如何生成一个在我未登录时有效的Acces令牌?

Thanks a lot 非常感谢

Vincent 文森特

You have to GET a new token each time you communicate without the Facebook api. 每次没有Facebook api进行通信时,您必须获取新令牌。 (at least for most queries) (至少对于大多数查询)

So you have to implement some kind of authentication using the Facebook api. 所以你必须使用Facebook api实现某种身份验证。

There are different libraries you can use in JavaScript or Othello languages. 您可以在JavaScript或Othello语言中使用不同的库。 Facebook graph explorer just lets you test api functions. Facebook图形浏览器只是让你测试api功能。 Its not a copy paste solution. 它不是复制粘贴解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM