@@ -107,18 +107,20 @@ go.login(provider);
107
107
* you will need to store the refresh_token that you can get the first time with provider.getRefreshToken()
108
108
* ! The API does not store the refresh token for you !
109
109
* log in using the refresh token like this :
110
+ * - Needs hasher - example below
110
111
*/
111
112
PokemonGo go = new PokemonGo (httpClient);
112
- go. login(new GoogleUserCredentialProvider (httpClient, refreshToken));
113
+ go. login(new GoogleUserCredentialProvider (httpClient, refreshToken), hasher );
113
114
114
115
/**
115
116
* PTC is much simpler, but less secure.
116
117
* You will need the username and password for each user log in
117
118
* This account does not currently support a refresh_token.
118
119
* Example log in :
120
+ * - Needs hasher - example below
119
121
*/
120
122
PokemonGo go = new PokemonGo (httpClient);
121
- go. login(new PtcCredentialProvider (httpClient, username, password));
123
+ go. login(new PtcCredentialProvider (httpClient, username, password), hasher );
122
124
123
125
// After this you can access the api from the PokemonGo instance :
124
126
go. getPlayerProfile(); // to get the user profile
@@ -143,6 +145,15 @@ try {
143
145
// its possible that the parsing fail when servers are in high load for example.
144
146
throw new RemoteServerException (e);
145
147
}
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
+
146
157
```
147
158
148
159
## (Async)CatchOptions
0 commit comments