Giter Club home page Giter Club logo

Comments (18)

Ni42 avatar Ni42 commented on June 29, 2024 1

Yes, they did, and it's pretty heavy.
https://www.reddit.com/r/pokemongodev/comments/4w1cvr/pokemongo_current_api_status/

from pokemongoapi-php.

Spettacolo83 avatar Spettacolo83 commented on June 29, 2024

I tried to call this function from NicklasW\PkmGoApi\Services\Request\MapRequestService:

    public function getResources($latitude, $longitude)
    {
        // Retrieve a list of cell ids from the latitude and longitude
        $cellIds = S2::getCellIds($latitude, $longitude);

        // Retrieve the map resources
        $resources = $this->getRequestService()->getResources($latitude, $longitude, $cellIds);

        print_r('Resources: '.$resources);
    }

But it return all the array void:

        forts=>array(
        )
        spawn_points=>array(
        )
        deleted_objects=>array(
        )
        fort_summaries=>array(
        )
        decimated_spawn_points=>array(
        )
        wild_pokemons=>array(
        )
        catchable_pokemons=>array(
        )
        nearby_pokemons=>array(
        )

Do you know how can I fix it?

from pokemongoapi-php.

NicklasWallgren avatar NicklasWallgren commented on June 29, 2024

The Map API is not done yet, you'll have to wait a bit more ;)

from pokemongoapi-php.

NicklasWallgren avatar NicklasWallgren commented on June 29, 2024

You could try this snippet while you wait.

$application = new ApplicationKernel('INSERT_USER', 'INSERT_PASSWORD', Factory::AUTHENTICATION_TYPE_PTC);

$application->setLocation(INSERT_LATITUDE, INSERT_LONGITUDE);

$map = new Map();
$map->update();

var_dump($map->getPokestops());

from pokemongoapi-php.

Spettacolo83 avatar Spettacolo83 commented on June 29, 2024

Thank you so much! If I can help you, let me know!

Only one time getPokestops() gave me a complete array, but now is always void!

That is an example of what I've received:

[0]=>
  object(NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort)#50 (16) {
    ["id":protected]=>
    string(35) "2bb412d263b2457881354a707c779cc6.16"
    ["lastModifiedTimestampMs":protected]=>
    int(1470036347544)
    ["latitude":protected]=>
    float(52.588293)
    ["longitude":protected]=>
    float(-2.115976)
    ["enabled":protected]=>
    bool(true)
    ["type":protected]=>
    int(1)
    ["ownedByTeam":protected]=>
    int(0)
    ["guardPokemonId":protected]=>
    int(0)
    ["guardPokemonCp":protected]=>
    int(0)
    ["gymPoints":protected]=>
    int(0)
    ["isInBattle":protected]=>
    bool(false)
    ["cooldownCompleteTimestampMs":protected]=>
    int(0)
    ["sponsor":protected]=>
    int(0)
    ["renderingType":protected]=>
    int(0)
    ["activeFortModifier":protected]=>
    string(0) ""
    ["lureInfo":protected]=>
    NULL
  }
  [1]=>
  object(NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort)#639 (16) {
    ["id":protected]=>
    string(35) "94dbfe8dfb9d4785a5e6fe10085756f9.16"
    ["lastModifiedTimestampMs":protected]=>
    int(1470047822589)
    ["latitude":protected]=>
    float(52.596062)
    ["longitude":protected]=>
    float(-2.114933)
    ["enabled":protected]=>
    bool(true)
    ["type":protected]=>
    int(1)
    ["ownedByTeam":protected]=>
    int(0)
    ["guardPokemonId":protected]=>
    int(0)
    ["guardPokemonCp":protected]=>
    int(0)
    ["gymPoints":protected]=>
    int(0)
    ["isInBattle":protected]=>
    bool(false)
    ["cooldownCompleteTimestampMs":protected]=>
    int(0)
    ["sponsor":protected]=>
    int(0)
    ["renderingType":protected]=>
    int(0)
    ["activeFortModifier":protected]=>
    string(0) ""
    ["lureInfo":protected]=>
    NULL
  }

Do you know where is the name of the PokeStop?

I look forward to getNearbyPokemon ;)

from pokemongoapi-php.

Ni42 avatar Ni42 commented on June 29, 2024

Names are only in the fort details response, which I think is not exposed yet.
But I'm also waiting for this to be implemented, I like the clean API already :)

from pokemongoapi-php.

Skullfox avatar Skullfox commented on June 29, 2024
....
$application->setLocation(INSERT_LATITUDE, INSERT_LONGITUDE);
$map = new Map();
$map->update();
var_dump($map->getPokestops());
....

Returns the following:

Parse error: syntax error, unexpected 'DEFAULT' (T_DEFAULT), expecting identifier (T_STRING) or class (T_CLASS) in /home/www/..../res/POGOProtos/Map/Fort/FortData.php on line 33

from pokemongoapi-php.

NicklasWallgren avatar NicklasWallgren commented on June 29, 2024

Replace INSERT_LATITUDE and INSERT_LONGITUDE with valid values.

from pokemongoapi-php.

Skullfox avatar Skullfox commented on June 29, 2024
$application->setLocation(47.466582, 9.750203);
$map = new Map();
$map->update();
var_dump($map->getPokestops());

returns :

Parse error: syntax error, unexpected 'DEFAULT' (T_DEFAULT), expecting identifier (T_STRING) or class (T_CLASS) in /home/www/..../res/POGOProtos/Map/Fort/FortData.php on line 33

from pokemongoapi-php.

Ni42 avatar Ni42 commented on June 29, 2024

Which PHP version are you using? This sounds like a very old one.

from pokemongoapi-php.

Skullfox avatar Skullfox commented on June 29, 2024

Version 5.6.22, should update to v7 asap

from pokemongoapi-php.

Ni42 avatar Ni42 commented on June 29, 2024

I was wrong, it's not the class constants, but a reserved word, just get the newest version.
PHP 5.6 should work fine, anyways.

from pokemongoapi-php.

baskettcase avatar baskettcase commented on June 29, 2024

Hi @NicklasWallgren any idea on the Map API release date? :)

from pokemongoapi-php.

Skullfox avatar Skullfox commented on June 29, 2024

Looks like Niantic changed something again, get no response(empty array) for getPokestops() & getGyms.

from pokemongoapi-php.

Spettacolo83 avatar Spettacolo83 commented on June 29, 2024

The login and getProfileData is still working!
Do you know how can I retrieve the "gyms currently conquered" value?
I didn't find it! Thanks!

from pokemongoapi-php.

jimmcq avatar jimmcq commented on June 29, 2024

Is map data working now? or no?

If it is, an example to get Pokestops and Gyms would be awesome.

from pokemongoapi-php.

Ni42 avatar Ni42 commented on June 29, 2024

Nope, needs to wait for #65

from pokemongoapi-php.

Spettacolo83 avatar Spettacolo83 commented on June 29, 2024

The old method does not work:

$application->setLocation(47.466582, 9.750203);
$map = new Map();
$map->update();
var_dump($map->getPokestops());

How can I get the list of Pokestops with the new version of API?

from pokemongoapi-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.