https://www.facebook.com/profile.php?id=100010558444183
我想在用户使用Facebook登录时获取此个人资料ID。
我试过这个,但它给了别的东西。
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/me',$access_token);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$user = $response->getGraphUser();
$id = $user['id']; ```
您不能再获得“真实”ID,只有App Scoped ID是唯一的,仍可用于识别返回用户。如果要获取用户配置文件的链接,请使用http://
例如:
link
更多细节:https://developers.facebook.com/docs/graph-api/reference/v3.2/user