Google_Client is a PHP library used to interact with Google APIs. One of its methods is setApprovalPrompt, which allows the developer to set the type of permission prompt that should be displayed to the user when requesting access to specific Google APIs.
Example:
// initialising Google_Client with developer credentials $client = new Google_Client(); $client->setApplicationName("My Application"); $client->setClientId("YOUR_CLIENT_ID"); $client->setClientSecret("YOUR_CLIENT_SECRET");
// setting approval prompt type $client->setApprovalPrompt('force');
// specifying scopes for API access $client->setScopes(['https://www.googleapis.com/auth/drive']);
In the above example, the setApprovalPrompt method is used to set the approval prompt type as "force", which means that the user will always be prompted to grant permission, even if they have done so before. The setScopes method specifies the Google API scopes that the developer wants to access.
Package/library: google/apiclient.
PHP Google_Client::setApprovalPrompt - 30 examples found. These are the top rated real world PHP examples of Google_Client::setApprovalPrompt extracted from open source projects. You can rate examples to help us improve the quality of examples.