简体   繁体   English

从应用程序获取具有Facebook访问令牌的用户供稿

[英]Get user feed with Facebook access token from app

For a website i'm building a need to get Facebook feed from a users page and display it on a website. 对于网站,我正在构建一个从用户页面获取Facebook feed并将其显示在网站上的需求。 I've been able to get this working, only i'm using an user-access-token, which expires in about 2 hours. 我能够使它正常工作,只有我使用的是用户访问令牌,该令牌将在2个小时后到期。

Is there any solution on how i can display the users feed on my website and don't need to refresh the access token all the time? 关于我如何在我的网站上显示用户供稿并且不需要一直刷新访问令牌,是否有任何解决方案? I also created an Facebook App, but when i try do use that app-access-token in my code i get an error. 我还创建了一个Facebook应用程序,但是当我尝试在我的代码中使用该应用程序访问令牌时,出现错误。 Saying i can not use that for user feed requests. 说我不能将其用于用户供稿请求。

I use graph to get all the users feed in JSON. 我使用图来获取JSON中的所有用户供稿。 Hopefully someone can explain to me how i can get a user-acces-token that won't expire or how i can use my app-access-token to get the feed from the user. 希望有人可以向我解释我如何获得不会过期的用户权限令牌,或者我如何使用我的应用程序访问权限令牌来获取用户的供稿。

Thanks 谢谢

You can't get an access token that doesn't expire, but you can get an extended life access token which can last for 60 days. 您不会获得永不过期的访问令牌,但可以获取可以使用60天的延长寿命的访问令牌。 Information about access tokens and various types of them can be found here: 有关访问令牌及其各种类型的信息,可以在这里找到:

https://developers.facebook.com/docs/facebook-login/access-tokens/ https://developers.facebook.com/docs/facebook-login/access-tokens/

More specifically about extending access tokens: 更具体地说,有关扩展访问令牌:

https://developers.facebook.com/docs/facebook-login/access-tokens/#extending https://developers.facebook.com/docs/facebook-login/access-tokens/#extending

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

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