如何在谷歌登录api中获取用户电话号码?

Mar*_* AJ 5 php google-api-client

这是我的代码:

$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->addScope("email");
$client->addScope("profile");
$service = new Google_Service_Oauth2($client);
$user = $service->userinfo->get(); //get user info
echo "<pre>";
print_r($user);
die;
Run Code Online (Sandbox Code Playgroud)

结果是:

/*
Google_Service_Oauth2_Userinfoplus Object
(
    [internal_gapi_mappings:protected] => Array
        (
            [familyName] => family_name
            [givenName] => given_name
            [verifiedEmail] => verified_email
        )

    [email] => MyEmailName@gmail.com
    [familyName] => Martinish
    [gender] => 
    [givenName] => Martin
    [hd] => 
    [id] => 11150231528512531xxx
    [link] => https://plus.google.com/111502315285125311xxx
    [locale] => en
    [name] => Martin Martinish
    [picture] => https://lh5.googleusercontent.com/-fVHMRUGw5z4/xxx/xxx/IhHnvxaOyAw/photo.jpg
    [verifiedEmail] => 1
    [modelData:protected] => Array
        (
            [verified_email] => 1
            [given_name] => Martin
            [family_name] => Martinish
        )

    [processed:protected] => Array
        (
        )

)
Run Code Online (Sandbox Code Playgroud)

现在我还需要获取用户的手机(手机)号码。我怎样才能做到这一点?


我已经添加了这些范围:(根据这个文档

https://www.googleapis.com/auth/contacts
https://www.googleapis.com/auth/contacts.readonly
https://www.googleapis.com/auth/user.phonenumbers.read
Run Code Online (Sandbox Code Playgroud)

但结果仍然完全相同。无论如何,知道如何检索/获得联系人(最好是手机号码)信息吗?