Skip to content

Commit 753d624

Browse files
committed
fix(google-signin): missing token
1 parent 0f74500 commit 753d624

8 files changed

Lines changed: 11 additions & 9 deletions

File tree

packages/google-signin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Disconnects the current user.
130130

131131
## getTokens()
132132

133-
Resolves with an object containing { idToken: string, accessToken: string, } or rejects with an error. Note that using accessToken for identity assertion on your backend server is discouraged.
133+
Resolves with an object containing { idToken: string, accessToken: string, } or rejects with an error. Note that using accessToken for identity assertion on your backend server is [discouraged](https://developers.google.com/identity/sign-in/android/migration-guide).
134134

135135
## getCurrentUser()
136136

packages/google-signin/index.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ export class GoogleSignin {
246246
}
247247

248248
static playServicesAvailable() {
249-
return org.nativescript.plugins.googlesignin.GoogleSignIn.playServicesAvailable(false, Application.android.foregroundActivity || Application.android.startActivity);
249+
return new Promise((resolve, reject) => {
250+
resolve(org.nativescript.plugins.googlesignin.GoogleSignIn.playServicesAvailable(false, Application.android.foregroundActivity || Application.android.startActivity));
251+
})
250252
}
251253
}
252254

packages/google-signin/index.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class GoogleSignin {
213213
}
214214

215215
static playServicesAvailable() {
216-
return true;
216+
return Promise.resolve(true);
217217
}
218218

219219
static get topViewController(): UIViewController | undefined {

packages/google-signin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/google-signin",
3-
"version": "1.0.0-alpha.9",
3+
"version": "1.0.0-alpha.10",
44
"description": "Google Sign-in for your NativeScript applications",
55
"main": "index",
66
"typings": "index.d.ts",
-380 Bytes
Binary file not shown.

packages/google-signin/src-native/android/.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-signin/src-native/android/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-signin/src-native/android/googlesignin/src/main/java/org/nativescript/plugins/googlesignin/GoogleSignIn.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ class GoogleSignIn {
251251
private fun scopesToString(scopes: Set<Scope>): String {
252252
val sb = StringBuilder("oauth2:")
253253
for (scope in scopes) {
254-
sb.append(scopes.toString()).append(" ")
254+
sb.append(scope.toString()).append(" ")
255255
}
256-
return sb.toString().trim { it <= ' ' }
256+
return sb.toString().trim()
257257
}
258258

259259
@Throws(
@@ -304,7 +304,7 @@ class GoogleSignIn {
304304
}
305305
} catch (e: Exception) {
306306
runOnMain {
307-
callback.onError(Exception(GET_TOKENS_ERROR))
307+
callback.onError(e)
308308
}
309309
}
310310
}

0 commit comments

Comments
 (0)