2014-03-04 74 views
0

我同時使用Facebook的API收到此錯誤返回,但是當我print_r的對象,這是我所得到的:未捕獲OAuthException:活動的訪問令牌必須使用...這是即使訪問令牌被發現

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 /> 

上面的部分說有一個訪問令牌如何我不能使用它?

回答

1

從提供接入令牌的結構之前,我刪除它(請,永遠展示您的應用ID,應用密鑰和訪問令牌的公共網站上!!!),好像你正在使用的應用程序訪問令牌而不是用戶訪問令牌。

你必須使用你想查詢用戶信息,後者每次。

相關問題