简体   繁体   English

Facebook永久访问令牌

[英]Facebook Permanent Access Token

I am working as part of a team for a company that wishes to display the time of the last post on a dashboard for a Facebook post. 我正在一家公司的团队中工作,该公司希望在Facebook帖子的仪表板上显示最近发布的时间。 This is for a webpage. 这是一个网页。

To do this, an access token is required. 为此,需要访问令牌。

The standard Facebook token lasts for 1-2 hours, before it becomes unusable. 在无法使用之前,标准的Facebook令牌会持续1-2小时。 There is an option to exchange this temporary token for a longer-term version , which lasts 60 days (~2 months). 您可以选择将该临时令牌换成长期版本,期限为60天(约2个月)。 Is there a token that is permanent? 有永久的令牌吗? (ie. Has no expiry date). (即没有有效期)。

EDIT 编辑

This is for a HTML page that has some PHP code to display the time of the last post for a specific Facebook profile. 这是用于HTML页面,该页面具有一些PHP代码,以显示特定Facebook个人资料的最后发布时间。

EDIT2 编辑2

This is the situation: 这种情况:

The company I am working for currently has a HTML page that has a lot of statistics such as weather, alerts, graphs and other JavaScript widgets on a page. 我正在工作的公司目前有一个HTML页面,该页面上有很多统计信息,例如天气,警报,图表和其他JavaScript小部件。 I have been asked to display a little section that displays the time of the last post for a certain Facebook profile. 我被要求显示一个小部分,显示某个Facebook个人资料的最后发布时间。 To do this, should I build a 'Facebook App', or is there another better way to retrieve this information? 为此,我应该构建一个“ Facebook应用程序”,还是有另一种更好的方法来检索此信息? Can I use the Facebook API to get the last post without creating a Facebook app? 我可以在不创建Facebook应用的情况下使用Facebook API获取最新帖子吗?

As far as I know offline_access has been deprecated so there is no option to get permanent access_token . 据我所知, offline_access已被弃用,因此没有选择获取永久的access_token The longest one you can get lasts for 60 days. 最长的可以持续60天。

If you want to show date of the last post for specific account (I suppose this is for viewers account) you can create Facebook app, ask for read_stream extended permission, check date of the last post and display it in one request (use JavaScript SDK). 如果要显示特定帐户的最新帖子的日期(我想这是针对查看者帐户的),则可以创建Facebook应用,请求read_stream扩展权限,检查最后发布的日期并将其显示在一个请求中(使用JavaScript SDK) )。

You can fetch it last post with 您可以使用

/me/feed?limit=1

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

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