public function run()
 {
     $PokemonGoAPILogin = (new \PokemonGoAPI\Auth\GoogleLogin())->login('*****@*****.**', 'password');
     $PokemonGoAPI = new PokemonGoAPI($PokemonGoAPILogin);
     $PokemonGoAPI->getOutput()->setPKGODEBUG(true);
     $PokemonGoAPI->getOutput()->write($PokemonGoAPI->getPlayerProfile()->getUsername());
 }
Ejemplo n.º 2
0
 /**
  * BaseExample constructor.
  */
 public function __construct()
 {
     $dotenv = new Dotenv\Dotenv(__DIR__);
     $dotenv->load();
     $googleLogin = new \PokemonGoAPI\Auth\GoogleLogin();
     $loginData = ($token = @file_get_contents('.token')) ? $googleLogin->loginWithGoogleToken($token) : $googleLogin->login(getenv('EMAIL'), getenv('PASSWORD'));
     // or by pair email/password
     file_put_contents('.token', $loginData['Auth']);
     $this->api = new PokemonGoAPI($loginData);
     $this->api->getOutput()->setPKGODEBUG(true);
 }
Ejemplo n.º 3
0
 /**
  * @param $id
  * @param $lon
  * @param $lat
  * @return FortDetails
  */
 public function getFortDetails($id, $lon, $lat)
 {
     $reqMsg = new FortDetailsMessage();
     $reqMsg->setFortId($id);
     $reqMsg->setLatitude($lat);
     $reqMsg->setLongitude($lon);
     $serverRequest = new ServerRequest(RequestType::FORT_DETAILS, $reqMsg);
     $this->pokemonGoAPI->getRequestHandler()->sendServerRequests($serverRequest);
     $response = new FortDetailsResponse($serverRequest->getData());
     return new FortDetails($response);
 }