I am currently having problems on the google-api-php-client library. when I use the fetchAccessTokenWithAuthCode() method I get a critical error. it would come from $httpHandler which should be a callback function $httpHandler = HttpHandlerFactory::build($this->getHttpClient());
which is actually an object...
Has anyone had this problem before?
thanks in advance.
$gClient = new Google_Client();
$GLOBALS['gClient'] = $gClient;
$gClient->setClientId( '' ); //omitted for privacy
$gClient->setClientSecret( '' ); //omitted for privacy
$gClient->setApplicationName( 'Mon application' );
$gClient->setRedirectUri( 'http://localhost/vevweb/wp-admin/admin-ajax.php?action=vm_login_google' );
$gClient->addScope( 'https://www.googleapis.com/auth/userinfo.email' );
if( isset( $_GET['code'] ) ) {
$gClient->authenticate($_GET['code']);//This code return critical error
}