简体   繁体   中英

Facebook Graph API get access token

I'm new to Facebook Development using PHP. I have created a nice script which gathers the facebook news feed from my fan page to a JSON array using the graph api.... eg//

  $url="https://graph.facebook.com/".$fbID."/feed?access_token=".$token."&limit=20";

(ghdn using the curl commands to collect the JSON..)

The problem is the access token expires after 2 hours, how can I make this not expire or renew?

Thanks for any help...

If your fan page is public and has no restrictions like demographic restriction, then you can use your App Access Token to query and retrieve your fan page's feed.

In case your fan page is having restrictions you may use Page Access Token by giving your app manage_pages permission and retrieving Page Access Token using following Graph request

/{user-id}/accounts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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