File tree 2 files changed +8
-8
lines changed
src/main/java/com/google/firebase/quickstart
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 22
22
dependencies {
23
23
testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
24
24
25
- compile ' com.google.api-client :google-api-client:1.22 .0'
26
- compile ' com.google.code.gson:gson:2.8.1 '
25
+ compile ' com.google.auth :google-auth-library-oauth2-http:0.26 .0'
26
+ compile ' com.google.code.gson:gson:2.8.7 '
27
27
}
Original file line number Diff line number Diff line change 1
1
package com .google .firebase .quickstart ;
2
2
3
- import com .google .api . client . googleapis . auth .oauth2 .GoogleCredential ;
3
+ import com .google .auth .oauth2 .GoogleCredentials ;
4
4
import com .google .gson .Gson ;
5
5
import com .google .gson .GsonBuilder ;
6
6
import com .google .gson .JsonObject ;
@@ -43,11 +43,11 @@ public class Messaging {
43
43
*/
44
44
// [START retrieve_access_token]
45
45
private static String getAccessToken () throws IOException {
46
- GoogleCredential googleCredential = GoogleCredential
47
- .fromStream (new FileInputStream ("service-account.json" ))
48
- .createScoped (Arrays .asList (SCOPES ));
49
- googleCredential . refreshToken ();
50
- return googleCredential .getAccessToken ();
46
+ GoogleCredentials googleCredentials = GoogleCredentials
47
+ .fromStream (new FileInputStream ("service-account.json" ))
48
+ .createScoped (Arrays .asList (SCOPES ));
49
+ googleCredentials . refreshAccessToken ();
50
+ return googleCredentials .getAccessToken (). getTokenValue ();
51
51
}
52
52
// [END retrieve_access_token]
53
53
You can’t perform that action at this time.
0 commit comments