@@ -107,18 +107,20 @@ go.login(provider);
107107* you will need to store the refresh_token that you can get the first time with provider.getRefreshToken()
108108* ! The API does not store the refresh token for you !
109109* log in using the refresh token like this :
110+ * - Needs hasher - example below
110111*/
111112PokemonGo go = new PokemonGo (httpClient);
112- go. login(new GoogleUserCredentialProvider (httpClient, refreshToken));
113+ go. login(new GoogleUserCredentialProvider (httpClient, refreshToken), hasher );
113114
114115/**
115116* PTC is much simpler, but less secure.
116117* You will need the username and password for each user log in
117118* This account does not currently support a refresh_token.
118119* Example log in :
120+ * - Needs hasher - example below
119121*/
120122PokemonGo go = new PokemonGo (httpClient);
121- go. login(new PtcCredentialProvider (httpClient, username, password));
123+ go. login(new PtcCredentialProvider (httpClient, username, password), hasher );
122124
123125// After this you can access the api from the PokemonGo instance :
124126go. getPlayerProfile(); // to get the user profile
@@ -143,6 +145,15 @@ try {
143145 // its possible that the parsing fail when servers are in high load for example.
144146 throw new RemoteServerException (e);
145147}
148+
149+ public static HashProvider getHashProvider(){
150+ String POKEHASH_KEY = " ****************" ;
151+ if (POKEHASH_KEY != null && POKEHASH_KEY . length() > 0 ){
152+ return new PokeHashProvider (PokeHashKey . from(POKEHASH_KEY ), true );
153+ }
154+ throw new IllegalStateException (" Cannot start example without hash key" );
155+ }
156+
146157```
147158
148159## (Async)CatchOptions
0 commit comments