简体   繁体   English

Facebook JS API,无需身份验证即可访问公共照片

[英]Facebook JS API, accessing public photos without authentication

I am looking to know is there a way to get a listing of photos in a specific album on a specific page (where both the album and page are public). 我想知道是否有一种方法可以在特定页面(该相册和页面都是公开的)上获得特定相册中的照片列表。 Without the need to authenticate at a user level. 无需在用户级别进行身份验证。 I basically am looking to show a number of photos from an organisations page on that organisations website (however I dont want to show them all). 我基本上希望显示该组织网站上某个组织页面上的许多照片(但是我不想全部显示)。

I have followed the examples here: 我在这里遵循了以下示例:

https://developers.facebook.com/docs/javascript/quickstart and here: https://developers.facebook.com/docs/graph-api/reference/v2.7/album/photos https://developers.facebook.com/docs/javascript/quickstart以及此处: https : //developers.facebook.com/docs/graph-api/reference/v2.7/album/photos

but I cant appear to get a listing of photos. 但我似乎看不到照片清单。 Is it possible to get such a listing without the user authenticating with FB first? 无需用户先通过FB认证就可以获得这样的列表吗?

It is possible, you can use an App Access Token if the Page is not restricted by age or location, or a Page Access Token if the Page is restricted. 如果页面不受年龄或位置的限制,则可以使用应用程序访问令牌;如果页面受到限制,则可以使用页面访问令牌 App Tokens and Extended Page Tokens are valid forever, so you can just store those on your server to make the API calls. 应用程序令牌扩展页面令牌是永远有效的,因此您只需将它们存储在服务器上即可进行API调用。 No additional user authorization needed. 无需其他用户授权。

Information about how to generate the different Tokens can be found here: 可以在以下位置找到有关如何生成不同令牌的信息:

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

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