0

我开发了一个 Andriod 应用程序,在我将电话号码发送到 Facebook 帐户工具包之后,我使用 Facebook 帐户工具包验证电话号码,然后 Facebook 向客户端发送访问令牌,然后我将客户端访问令牌发送到我的网络服务器和从 web 服务器到 account kit 如下:

$access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxx';
$app_secret = 'yyyyyyyyyyyyyyyyyyyyyyy';
$appsecret_proof = hash_hmac('sha256', $access_token, $app_secret);  
$url = 'https://graph.facebook.com/v2.1/me?access_token='.$access_token.'&appsecret_proof='.$appsecret_proof;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
curl_close($ch);  
$final = json_decode($result);   
echo"<pre>";print_r($final);

但它给出了如下所示的错误:

stdClass Object
(
   [error]=> stdClass Object
   (
       [message]=>Malformed access token
       [type]=>OAuthException
       [code]=>190
       [fbtrace_id]=>FQftlVOKYL+
   )
)

我的帐户工具包设置中的应用程序设置如下: 在此处输入图像描述

任何解决方案,请!

4

1 回答 1

2

您应该调用 Account Kit 图形 API 而不是 Facebook 的。

https://developers.facebook.com/docs/accountkit/graphapi

于 2016-08-17T01:01:21.053 回答