From 5a87e7acb5b611d73c22b90d7fcc2f0ab65f9d81 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Wed, 23 Aug 2023 16:32:02 -0700 Subject: [PATCH 1/2] Remove unnecessary parameter useed in creating GACAppAttestProvider --- GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m | 1 - 1 file changed, 1 deletion(-) diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m index 3ef6e05b..c297e60a 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m @@ -162,7 +162,6 @@ + (NSString *)appAttestResourceName { baseURL:kGIDAppAttestBaseURL APIKey:nil keychainAccessGroup:nil - limitedUse:YES requestHooks:nil]; } From 4e3bae8063ba1351d57cb90a1999f627b0f2df11 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Wed, 23 Aug 2023 17:01:52 -0700 Subject: [PATCH 2/2] Update podspec for new AppCheckCore alpha Update related GACAppCheck API changes as well. --- GoogleSignIn.podspec | 2 +- .../Implementations/Fake/GIDAppCheckProviderFake.m | 9 ++++++++- .../Sources/GIDAppCheck/Implementations/GIDAppCheck.m | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/GoogleSignIn.podspec b/GoogleSignIn.podspec index 8dc255a9..8c7d93b7 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', '~> 0.1.0-alpha' + s.dependency 'AppCheckCore', '~> 0.1.0-alpha.4' s.dependency 'AppAuth', '~> 1.6' s.dependency 'GTMAppAuth', '~> 4.0' s.dependency 'GTMSessionFetcher/Core', '>= 1.1', '< 4.0' diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m index 8dc61095..0a3dfb1a 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.m @@ -38,13 +38,20 @@ - (instancetype)initWithAppCheckToken:(nullable id)tok return self; } -- (void)getTokenWithCompletion:(nonnull void (^)(GACAppCheckToken * _Nullable, +- (void)getTokenWithCompletion:(nonnull void (^)(id _Nullable, NSError * _Nullable))handler { dispatch_async(dispatch_get_main_queue(), ^{ handler(self.token, self.error); }); } +- (void)getLimitedUseTokenWithCompletion:(void (^)(id _Nullable, + NSError * _Nullable))handler { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(self.token, self.error); + }); +} + @end #endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST diff --git a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m index c297e60a..97a74241 100644 --- a/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m +++ b/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m @@ -110,8 +110,8 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) return; } - [self.appCheck getLimitedUseTokenWithCompletion:^(id _Nullable token, - NSError * _Nullable error) { + [self.appCheck limitedUseTokenWithCompletion:^(id _Nullable token, + NSError * _Nullable error) { NSError * __block maybeError = error; @synchronized (self) { if (!token && !error) { @@ -139,8 +139,8 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion) - (void)getLimitedUseTokenWithCompletion:(nullable GIDAppCheckTokenCompletion)completion { dispatch_async(self.workerQueue, ^{ - [self.appCheck getLimitedUseTokenWithCompletion:^(id _Nullable token, - NSError * _Nullable error) { + [self.appCheck limitedUseTokenWithCompletion:^(id _Nullable token, + NSError * _Nullable error) { if (token) { [self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey]; }