NicklasWallgren / PokemonGoAPI-PHP

Pokemon Go API PHP library
BSD 2-Clause "Simplified" License
130 stars 51 forks source link

Login with google API #137

Closed vntopcoders closed 7 years ago

vntopcoders commented 7 years ago

My source code as:

$config = new Config();
$config->setProvider(Factory::PROVIDER_GOOGLE);
$config->setAuthToken($_GET["code"]);
$manager = Factory::create($config);
$manager->addListener(function ($event, $value) {
        if ($event === Manager::EVENT_ACCESS_TOKEN) {
            /** @var AccessToken $accessToken */
            $_SESSION["accessToken"]= $value;
            // Persist the access token in session storage, cache or whatever.
            // The persisted access token should be passed to the Authentication factory for authentication
        }
    });
    // Initialize the pokemon go application
    $application = new ApplicationKernel($manager);

But I had got the error: [error] 28915#0: *631 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'DI\NotFoundException' with message 'No entry or class found for 'config'' in /usr/share/nginx/html/poke/vendor/php-di/php-di/src/DI/Container.php:119 Please help me to check it.