Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use get_gym_details function? #204

Open
legz opened this issue Aug 8, 2016 · 4 comments
Open

How to use get_gym_details function? #204

legz opened this issue Aug 8, 2016 · 4 comments

Comments

@legz
Copy link

legz commented Aug 8, 2016

I try to use get_gym_details to collect some info on the gyms around me but I can't figure how to use the function.
I tried this :

    gym={
        'gid':'0d39156d87f74263ac595d3ab2a2f728.16',
        'glatitude':45.876373,
        'glongitude':4.713474
        }
response= api.get_gym_details(gym_id = gym['gid'], gym_latitude = gym['glatitude'], gym_longitude = gym['glongitude'])
print('Response : \n\r{}'.format(pprint.PrettyPrinter(indent=4).pformat(response)))

But all I get is this:

...
[ INFO] Login process completed
[ INFO] Creating a new direct request...
[ INFO] Adding 'GET_GYM_DETAILS' to RPC request including arguments
[ INFO] Execution of RPC
[ INFO] Cleanup of request!
Response : 
{   'request_id': 746011827811372547L,
    'responses': {   'GET_GYM_DETAILS': {   'result': 2}},
    'status_code': 1}

Any idea on how to do a proper get_gym_details request please?

@genIterator
Copy link

@legz
Copy link
Author

legz commented Aug 9, 2016

I though it was optional, thanks.
I updated my request with this :

    gym={
        'gid':'7a7fcf27f2b848b2a8fc312a839471f9.11',
        'glatitude':45.773084,
        'glongitude':4.808241
        }
    response= api.get_gym_details(
        gym_id = gym['gid'],
        player_latitude = position[0],
        player_longitude = position[1],
        gym_latitude = gym['glatitude'],
        gym_longitude = gym['glongitude'])
    print('Response : \n\r{}'.format(pprint.PrettyPrinter(indent=4).pformat(response)))

but I have the exact same result.
(player position is 45.7730123, 4.8084165, there is 15m between player position and gym position.)

@genIterator
Copy link

Well, the proto states that result 2 is ERROR_NOT_IN_RANGE:
https://github.com/AeonLucid/POGOProtos/blob/master/src/POGOProtos/Networking/Responses/GetGymDetailsResponse.proto
Might be an issue due to the fact that the API is not up to date. See the pull request for further details and links: #182

@legz
Copy link
Author

legz commented Aug 9, 2016

I already use the KeyPhact version with uk6 &co (they closed my issue on their repo without much investigation btw)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants