替代在Facebook上访问用户个人资料的离线访问权限? [英] Alternative to offline access permission for accessing a users profile on facebook?

查看:101
本文介绍了替代在Facebook上访问用户个人资料的离线访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook已经弃用了离线访问权限的权限。作为一名开发人员,有一些其他方式可以让我在用户不在网上发布,或者只有当他在访问我的应用程序?

Facebook has deprecated the offline access permission.As a developer is there some other way for me to post on the wall of a user when he is not online or I can do that only when he is accessing my app?

推荐答案

您可以在应用中增加2个表列,即short_access_token& long_access_token。

You can increase 2 table columns in your app namely short_access_token & long_access_token.

一旦用户认证您的应用程序,就会生成访问令牌,将其存储在short_access_token中。然后将此访问令牌传递给:

Once user authenticates your app, an access token is generated, store it in short_access_token. Then pass this access token to:

https:/ /graph.facebook.com/oauth/access_token

client_id = APP_ID&
client_secret = APP_SECRET&
grant_type = fb_exchange_token&
fb_exchange_token = EXISTING_ACCESS_TOKEN

https://graph.facebook.com/oauth/access_token?
client_id=APP_ID& client_secret=APP_SECRET& grant_type=fb_exchange_token& fb_exchange_token=EXISTING_ACCESS_TOKEN

一旦运行,将生成60天有效性的访问令牌。将其存储在long_access_token中。现在,使用这个long_access_token 60天。

Once you run this, an access token with 60 days validity will be generated. Store it in long_access_token. Now, use this long_access_token for 60 days.

您可以每天生成一次长期访问令牌,即第一次。使用这个长期访问令牌在用户墙上发布(如果您已经获得了许可)。

You can generate long lived access token only once a day i.e. the first time. Use this long lived access token to post on user's wall (if you've already got the permission).

参考: https://developers.facebook.com/roadmap/offline-access-removal/

这篇关于替代在Facebook上访问用户个人资料的离线访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆