Closed urmila-patel closed 8 years ago
As the token is fetched in the constructor, it will only do this when GAPI is first started - when you actually do this:
$ga = new gapi("XXXXXXXX@developer.gserviceaccount.com", "key.p12");
Therefore I suggest just simply creating a new object when this happens. Generally PHP scripts are not long running so this isn't a problem.
If you want, you can also add a new method to gapi.class.php (under the getToken function) with the following code:
private function fetchToken($email, $key, $delegate_email = null) {
$this->auth_method->fetchToken($client_email, $key_file, $delegate_email);
}
This will give you a method to refresh the token, please let me know if this doesn't work.
please give me solution