Making Page Access Tokens Never Expire With 2016 Facebook SDK?

天大地大妈咪最大 提交于 2019-12-01 00:27:39

Steps:

  1. Get the user-access-token having the permission manage_pages with it.
  2. Extend the token using (do it server side, since it involves app secret)

    https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={your_app_id}&client_secret={your_app_secret}&fb_exchange_token={user_token_from_last_step}

  3. Use the extended token from above step and use the API-

    /v2.5/{page-id}?fields=access_token
    

    You'll get the page access token in response, that'll never expire.

I think you're at step 2, just follow the step 3 and you're good to go.

I'll recommend you go through this page about the access tokens and things will be much clearer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!