Skip to content

Commit

Permalink
set the pendingOperation before auth starts for signInV2
Browse files Browse the repository at this point in the history
  • Loading branch information
Abedalkareem committed Sep 14, 2023
1 parent c19441b commit 4245e3d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Auth : PluginRegistry.ActivityResultListener {
) {
activity ?: return
if (!shouldEnableSavedGame) {
signInV2(activity)
signInV2(activity, result)
return
}
val signInOption = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
Expand All @@ -61,9 +61,9 @@ class Auth : PluginRegistry.ActivityResultListener {
}
}

private fun signInV2(activity: Activity) {
private fun signInV2(activity: Activity, result: MethodChannel.Result) {
val gamesSignInClient = PlayGames.getGamesSignInClient(activity)

pendingOperation = PendingOperation(Method.SilentSignIn.value(), result, activity)
gamesSignInClient.isAuthenticated.addOnCompleteListener { isAuthenticatedTask: Task<AuthenticationResult> ->
val isAuthenticated = isAuthenticatedTask.isSuccessful &&
isAuthenticatedTask.result.isAuthenticated
Expand Down

0 comments on commit 4245e3d

Please sign in to comment.