问题
I'm using php and downloaded the yahoo library to import yahoo user info.
I've already finished it and it has been working flawlessly, but now it has started to return:
Notice (8): Trying to get property of non-object [APP/Vendor/Yahoo/Yahoo.inc, line 1036]
This notice appears after logging in through yahoo. When I debug $user->getProfile()
it returns null.
I didn't change anything in my code that's why i don't have any idea what is causing it.
Please help!
This is the relevant part of my code:
App::import('Vendor', 'YahooInc', array('file' => 'Yahoo/Yahoo.inc'));
$session = YahooSession::requireSession($consumer_key,$consumer_secret,$app_id);
if (is_object($session)) {
$yahooUser = $session->getSessionedUser();
$yahooProfile = $yahooUser->getProfile();
}
回答1:
You have to replace your current Yahoo Api library with the below github branch.
https://github.com/syamvilakudy/yos-social-php
来源:https://stackoverflow.com/questions/20371336/yahoo-oauth-user-getprofile-returns-null