Abedalkareem / games_services

A Flutter plugin to support game center and google play games services.
118 stars 48 forks source link

[iOS] `GameAuth.isSignedIn` not working after user cancel the `GameAuth.signIn()` #158

Open jiak94 opened 5 months ago

jiak94 commented 5 months ago

reproduction steps:

  1. call GameAuth.signIn()
  2. cancel the signing
  3. call GameAuth.isSignedIn -> the return value is true
jiak94 commented 5 months ago
return GameAuth.isSignedIn.then((isSignedIn) {
      logger.fine('User is signed in: $isSignedIn');
      if (isSignedIn) {
        return Leaderboards.loadLeaderboardScores(
            iOSLeaderboardID: iosLeaderboardID,
            scope: PlayerScope.global,
            timeScope: TimeScope.allTime,
            maxResults: 10);
      } else {
        logger.fine('User is not signed in. Signing in...');
        return GameAuth.signIn().then((value) {
          logger.fine('Sign in result: $value');
          return Leaderboards.loadLeaderboardScores(
              iOSLeaderboardID: iosLeaderboardID,
              scope: PlayerScope.global,
              timeScope: TimeScope.allTime,
              maxResults: 10);
        });
      }
    });
image
Abedalkareem commented 4 months ago

That's odd, We are calling GameKit isAuthenticated method. currentPlayer.isAuthenticated

I tried also now and I'm getting the value of currentPlayer.isAuthenticated as true from the native side.