Welcome Guest, Not a member yet? Register   Sign In
CI 4 login with google. $client = new Google_Client();
#1

(This post was last modified: 05-10-2020, 04:48 AM by asklinux.)

i have install google api using compose 

composer require google/apiclient:"^2.0"

then its install google api lib in 

vendor/google

to user the lib just load like this

$client = new \Google_Client();

$client->setClientId(''); //Define your ClientID

$client->setClientSecret(''); //Define your Client Secret Key
$client->setRedirectUri(''); //Define your Redirect Uri
$client->addScope('email');
$client->addScope('profile');

ok i find how tu use after install with compose Big Grin
 $client = new Google_Client();
 $client = new Google_Client();
 $client = new Google_Client();[i] $cl[i] $client = new Google_Client();ient = new Google_Client();[/i][/i]
Reply
#2

(This post was last modified: 03-26-2021, 06:17 AM by titounnes.)

(05-10-2020, 03:29 AM)asklinux Wrote: i have install google api using compose 

composer require google/apiclient:"^2.0"

then its install google api lib in 

vendor/google

to user the lib just load like this

$client = new \Google_Client();

$client->setClientId(''); //Define your ClientID

$client->setClientSecret(''); //Define your Client Secret Key
$client->setRedirectUri(''); //Define your Redirect Uri
$client->addScope('email');
$client->addScope('profile');

ok i find how tu use after install with compose Big Grin
 $client = new Google_Client();
 $client = new Google_Client();
 $client = new Google_Client();[i] $cl[i] $client = new Google_Client();ient = new Google_Client();[/i][/i]
PHP Code:
<?php

namespace App\Controllers;

use 
App\Controllers\BaseController;
use 
Google\Client as Google_Client;
use 
Google_Service_Oauth2
Reply




Theme © iAndrew 2016 - Forum software by © MyBB