我正在建立一个网站,我想邀请用户gmail联系。
使用GmailOath using this我可以获取gmail用户联系人的电子邮件ID和电话号码,但我无法获取这些emailID的名称。
任何人都可以帮我这个。如何获得名字
我的代码是:
contact.php
<?php
include_once 'GmailOath.php';
include_once 'Config.php';
session_start();
$oauth =new GmailOath($consumer_key, $consumer_secret, $argarray, $debug, $callback);
$getcontact_access=new GmailGetContacts();
$request_token=$oauth->rfc3986_decode($_GET['oauth_token']);
$request_token_secret=$oauth->rfc3986_decode($_SESSION['oauth_token_secret']);
$oauth_verifier= $oauth->rfc3986_decode($_GET['oauth_verifier']);
$contact_access = $getcontact_access->get_access_token($oauth,$request_token, $request_token_secret,$oauth_verifier, false, true, true);
$access_token=$oauth->rfc3986_decode($contact_access['oauth_token']);
$access_token_secret=$oauth->rfc3986_decode($contact_access['oauth_token_secret']);
$contacts= $getcontact_access->GetContacts($oauth, $access_token, $access_token_secret, false, true,$emails_count);
foreach($contacts as $k => $a)
{
$final = end($contacts[$k]);
foreach($final as $email)
{
echo. $email["address"] ."<br />";
}
}
?>
我希望name
与emailid
。
注意:我试图使用提到http://openinviter.com/的HERE,但我没有。