From 29ec8188c2873cfdd1153709db816156485f537b Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 21 Aug 2026 16:08:10 -0700 Subject: [PATCH 1/4] fix test --- .../Implementations/Fake/GIDAppCheckProviderFake.h | 2 +- .../Implementations/Fake/GIDAppCheckProviderFake.m | 2 +- .../Sources/GIDAppCheck/Implementations/GIDAppCheck.m | 6 +----- GoogleSignIn/Sources/GIDSignIn.m | 2 +- GoogleSignIn/Tests/Unit/GIDAppCheckTest.m | 2 +- GoogleSignIn/Tests/Unit/GIDSignInTest.m | 7 +++++-- Package.swift | 7 ++++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h index e294273f..5a862c16 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h @@ -16,7 +16,7 @@ #import #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST -#import +@import AppCheckCore; @class GACAppCheckToken; diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m index 903fc3ff..44e54692 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m @@ -16,7 +16,7 @@ #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST -#import +@import AppCheckCore; NSUInteger const kGIDAppCheckProviderFakeError = 1; diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m index a886eec4..302f2aa8 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m @@ -18,11 +18,7 @@ #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST -#import -#import -#import -#import -#import +@import AppCheckCore; #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h" #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDAppCheckError.h" diff --git a/GoogleSignIn/Sources/GIDSignIn.m b/GoogleSignIn/Sources/GIDSignIn.m index abbb803e..f3ca57da 100644 --- a/GoogleSignIn/Sources/GIDSignIn.m +++ b/GoogleSignIn/Sources/GIDSignIn.m @@ -30,7 +30,7 @@ #import "GoogleSignIn/Sources/GIDSignInCallbackSchemes.h" #import "GoogleSignIn/Sources/GIDClaimsInternalOptions.h" #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST -#import +@import AppCheckCore; #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h" #import "GoogleSignIn/Sources/GIDAppCheck/UI/GIDActivityIndicatorViewController.h" #import "GoogleSignIn/Sources/GIDEMMErrorHandler.h" diff --git a/GoogleSignIn/Tests/Unit/GIDAppCheckTest.m b/GoogleSignIn/Tests/Unit/GIDAppCheckTest.m index 7c0610ae..61e0624e 100644 --- a/GoogleSignIn/Tests/Unit/GIDAppCheckTest.m +++ b/GoogleSignIn/Tests/Unit/GIDAppCheckTest.m @@ -17,7 +17,7 @@ #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST #import -#import +@import AppCheckCore; #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h" #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h" #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDAppCheckError.h" diff --git a/GoogleSignIn/Tests/Unit/GIDSignInTest.m b/GoogleSignIn/Tests/Unit/GIDSignInTest.m index ed959f12..658311a2 100644 --- a/GoogleSignIn/Tests/Unit/GIDSignInTest.m +++ b/GoogleSignIn/Tests/Unit/GIDSignInTest.m @@ -35,7 +35,7 @@ #import "GoogleSignIn/Sources/GIDClaimsInternalOptions.h" #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST -#import +@import AppCheckCore; #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h" #import "GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h" #import "GoogleSignIn/Sources/GIDEMMErrorHandler.h" @@ -426,8 +426,11 @@ - (void)testConfigureFailsNoTokenOrError { XCTestExpectation *configureFailsExpecation = [self expectationWithDescription:@"Configure fails expectation"]; + NSError *expectedError = [NSError errorWithDomain:kGIDAppCheckErrorDomain + code:kGIDAppCheckUnexpectedError + userInfo:nil]; GIDAppCheckProviderFake *fakeProvider = - [[GIDAppCheckProviderFake alloc] initWithAppCheckToken:nil error:nil]; + [[GIDAppCheckProviderFake alloc] initWithAppCheckToken:nil error:expectedError]; GIDAppCheck *appCheck = [[GIDAppCheck alloc] initWithAppCheckProvider:fakeProvider userDefaults:_testUserDefaults]; diff --git a/Package.swift b/Package.swift index bad348a0..119f7842 100644 --- a/Package.swift +++ b/Package.swift @@ -44,9 +44,10 @@ let package = Package( .package( url: "https://github.com/openid/AppAuth-iOS.git", from: "3.0.0"), - .package( - url: "https://github.com/google/app-check.git", - from: "11.0.0"), +// .package( +// url: "https://github.com/google/app-check.git", +// from: "11.0.0"), + .package(url: "https://github.com/google/app-check.git", branch: "pb-swift"), .package( url: "https://github.com/google/GTMAppAuth.git", from: "6.0.0"), From 13c3c054e8d42a6eeed2b57a68bb663f816c71c3 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 21 Aug 2026 16:22:09 -0700 Subject: [PATCH 2/4] Fix isPrepared logic in GIDAppCheck to check error instead of token --- .../Sources/GIDAppCheck/Implementations/GIDAppCheck.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m index 302f2aa8..8fb78dbe 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m @@ -119,7 +119,7 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) userInfo:nil]; } - if (result.token) { + if (!result.error) { [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; } @@ -139,9 +139,9 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) - (void)getLimitedUseTokenWithCompletion:(nullable GIDAppCheckTokenCompletion)completion { dispatch_async(self.workerQueue, ^{ [self.appCheck limitedUseTokenWithCompletion:^(GACAppCheckTokenResult * _Nonnull result) { - if (result.token) { - [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; - } + if (!result.error) { + [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; + } if (completion) { completion(result.token, result.error); } From 81faf5fb1c8bff9109dfcb3360457f3e3e42e1fb Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 21 Aug 2026 16:44:48 -0700 Subject: [PATCH 3/4] podspec testing --- .github/workflows/unit_tests.yml | 2 +- GoogleSignIn.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 67c9fd09..ee34bd27 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -36,7 +36,7 @@ jobs: # See #400 (https://github.com/google/GoogleSignIn-iOS/issues/400) run: | pod lib lint ${{ matrix.podspec }} --verbose \ - ${{ matrix.includePodspecFlag }} ${{ matrix.flag }} + ${{ matrix.includePodspecFlag }} ${{ matrix.flag }} --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/ spm-build-test: runs-on: ${{ matrix.os }} strategy: diff --git a/GoogleSignIn.podspec b/GoogleSignIn.podspec index 742534cd..5ebd148b 100644 --- a/GoogleSignIn.podspec +++ b/GoogleSignIn.podspec @@ -33,7 +33,7 @@ The Google Sign-In SDK allows users to sign in with their Google account from th ] s.ios.framework = 'UIKit' s.osx.framework = 'AppKit' - s.dependency 'AppCheckCore', '~> 11.0' + s.dependency 'AppCheckCore', '~> 12.0' s.dependency 'AppAuth', '~> 3.0' s.dependency 'GTMAppAuth', '~> 6.0' s.dependency 'GTMSessionFetcher/Core', '>= 3.3', '< 6.0' From dd7b8cadfb82b70ea93f12b215c3d1feab8f8779 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 21 Aug 2026 17:29:09 -0700 Subject: [PATCH 4/4] Address code review findings in GIDAppCheck --- .../GIDAppCheck/Implementations/GIDAppCheck.m | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m index 8fb78dbe..58296beb 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m @@ -113,12 +113,6 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) [self.appCheck limitedUseTokenWithCompletion:^(GACAppCheckTokenResult * _Nonnull result) { NSError * __block maybeError = result.error; @synchronized (self) { - if (!result.token && !result.error) { - maybeError = [NSError errorWithDomain:kGIDAppCheckErrorDomain - code:kGIDAppCheckUnexpectedError - userInfo:nil]; - } - if (!result.error) { [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; } @@ -139,9 +133,9 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) - (void)getLimitedUseTokenWithCompletion:(nullable GIDAppCheckTokenCompletion)completion { dispatch_async(self.workerQueue, ^{ [self.appCheck limitedUseTokenWithCompletion:^(GACAppCheckTokenResult * _Nonnull result) { - if (!result.error) { - [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; - } + if (!result.error) { + [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; + } if (completion) { completion(result.token, result.error); }