我已经按照代码通过其api检索yahoo联系人,但是它没有提取任何联系人。 这是我的代码:
session_start();
include_once 'config.php'; //This file contains consumer key & all data
require_once ('Yahoo.inc'); //This is a standard Yahoo file, just copied it
$session = YahooSession::requireSession($consumer_key,$consumer_secret,$app_id);
if (is_object($session))
{
$user = $session->getSessionedUser(); //This is NOT NULL
$profile = $user->getProfile(); //This is NULL
$name = $profile->givenNme;
$guid = $profile->guid;
$contacts=$user->getContacts()->contacts; //This is NULL
if($contacts==NULL){
echo "No contacts";
}
}
不知何故getProfile()
& getContacts()
无法正常运作。知道为什么它不能正常工作吗?