Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 77ab04b

Browse files
Added Google Access Token (Android) #880
1 parent 5e90e9a commit 77ab04b

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
},
1111
"dependencies": {
12-
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-6.5.0.tgz",
12+
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-6.6.0.tgz",
1313
"nativescript-theme-core": "^1.0.4",
1414
"nativescript-unit-test-runner": "^0.3.4",
1515
"tns-core-modules": "~4.2.0"

docs/AUTHENTICATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ Then add the following lines to your code and check for setup instructions for y
533533
);
534534
```
535535

536-
#### Google Access Token (Android only, iOS Coming soon)
536+
#### Google Access Token
537537
Upon successful authentication, Google creates an access token that can be obtained from the login method's result object. This access token can then be used for Google API:
538538

539539
```js

src/firebase.android.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,7 @@ function toLoginResult(user, additionalUserInfo?): User {
998998
providers.push({id: pid, token: firebase._facebookAccessToken});
999999
} else if (pid === 'google.com') {
10001000
providers.push({id: pid, token: firebase._googleSignInIdToken});
1001-
}
1002-
else {
1001+
} else {
10031002
providers.push({id: pid});
10041003
}
10051004
}

src/firebase.ios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,8 @@ function toLoginResult(user, additionalUserInfo?: FIRAdditionalUserInfo): User {
11361136
if (pid === 'facebook.com' && typeof(FBSDKAccessToken) !== "undefined") { // FIRFacebookAuthProviderID
11371137
const fbCurrentAccessToken = FBSDKAccessToken.currentAccessToken();
11381138
providers.push({id: pid, token: fbCurrentAccessToken ? fbCurrentAccessToken.tokenString : null});
1139+
} else if (pid === 'google.com' && typeof(GIDAuthentication) !== "undefined") {
1140+
providers.push({id: pid, token: firebase._gIDAuthentication ? (<GIDAuthentication>firebase._gIDAuthentication).accessToken : null});
11391141
} else {
11401142
providers.push({id: pid});
11411143
}

0 commit comments

Comments
 (0)