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

pogo.GetProfile throws exception after successful login #266

Open
hjw3001 opened this issue Mar 14, 2017 · 2 comments
Open

pogo.GetProfile throws exception after successful login #266

hjw3001 opened this issue Mar 14, 2017 · 2 comments

Comments

@hjw3001
Copy link

hjw3001 commented Mar 14, 2017

`
'use strict';

var PokemonGO = require('./poke.io.js');
var pogo = new PokemonGO.Pokeio();

var location = {
type: 'coords',
coords: {
latitude: -34.60537813731424,
longitude: -58.366670608520508
}
};

var username = 'user';
var password = 'password';
var provider = 'ptc';

pogo.init(username, password, location, provider, function(err) {
if (err) throw err;

console.log('Current location: ' + pogo.playerInfo.locationName);
console.log('lat/long/alt: : ' + pogo.playerInfo.latitude + ' ' + pogo.playerInfo.longitude + ' ' + pogo.playerInfo.altitude);

pogo.GetProfile(function(err, profile) {
    if (err) throw err;

    console.log('Username: ' + profile.username);

    var currency = {};
    for (var i in profile.currency){
        var type = profile.currency[i].type;
        var amount = profile.currency[i].amount;
        if (!amount){
            amount = 0;
        }
        currency[type] = amount;
    }
    console.log('Stardust: ' + currency['STARDUST']);
});

pogo.GetInventory(function(err, inventory){
    if (err) throw err;
    var cleanedInventory = { player_stats: null, eggs : [], pokemon: [], items: [] };
    console.log(inventory);
    callback(cleanedInventory);
});

});`

It looks like my user is successful in logging in, an exception keeps occuring on:

Pokeio.GetProfile

I'm using a new PTC account, one that so far I've just used for PokeSensor. This user hasn't caught any Pokemon. Is there some more steps I need to do with that user for GetProfile to work?

`[i] Logging with user: ...
[i] Session token: ...
[i] Received PTC access token!
[i] Received API Endpoint: https://null/rpc
Current location: ....
lat/long/alt: : ....
/Users/henrywagner/Developer/node/Pokemon-GO-node-api/demo.js:25
if (err) throw err;
^

Error: Error
at Request._callback (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/poke.io.js:266:27)
at self.callback (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/node_modules/request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/node_modules/request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
`

@bbuhler
Copy link

bbuhler commented Mar 17, 2017

I have the same issue.

Error: getaddrinfo EAI_AGAIN null:443

Seems like there is something wrong with the API Endpoint which gets also logged as "https://null/rpc".

There are some more issues regarding that:

In their case the server was down. But this doesn't seem to be the case here.

@billyriantono
Copy link
Collaborator

We need to update all things related with the Pokemon Go changes in order to make this library works again :)

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

3 participants