我在使用facebook api时遇到此错误,但是当我print_r对象时,这就是我得到的:
Facebook Object
(
[facebook] => Facebook Object
(
[sharedSessionID:protected] =>
[appId:protected] => APP_ID
[appSecret:protected] => APP_SECRET
[user:protected] => 0
[signedRequest:protected] =>
[state:protected] =>
[accessToken:protected] => ACCESS_TOKEN
[fileUploadSupport:protected] =>
[trustForwarded:protected] =>
)
[fb_perms] => Array
(
[scope] => publish_actions,
read_friendlists,
user_birthday,
email,
ads_management
)
[fb_user] => 0
[fb_user_profile] =>
)
<br />
<b>Fatal error</b>: Uncaught OAuthException: An active access token must be used to query information about the current user.
thrown in <b>base_facebook.php</b> on line <b>1271</b><br />
顶部说有一个访问令牌我怎么不能使用它?
答案 0 :(得分:1)
在我删除它之前提供的Access Token的结构(请永远不要在公共网站上显示你的App ID,App Secret和Access Token !!!),看起来你正在使用Application Access Token代替用户访问令牌。
每次要查询用户信息时都必须使用后者。