Skip to content

Commit 0967678

Browse files
committed
don't perform GTMAppAuth migration on catalyst
1 parent 2dbd46a commit 0967678

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

GoogleSignIn/Sources/GIDAuthStateMigration.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ - (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
7373
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
7474
#if TARGET_OS_OSX
7575
[defaults setBool:YES forKey:kDataProtectedMigrationCheckPerformedKey];
76-
#elif TARGET_OS_IOS
76+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
7777
[defaults setBool:YES forKey:kGTMAppAuthMigrationCheckPerformedKey];
7878
#endif // TARGET_OS_OSX
7979
return;
8080
}
8181

8282
#if TARGET_OS_OSX
8383
[self performDataProtectedMigrationIfNeeded];
84-
#elif TARGET_OS_IOS
84+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
8585
[self performGIDMigrationIfNeededWithTokenURL:tokenURL
8686
callbackPath:callbackPath
8787
keychainName:keychainName];
@@ -118,7 +118,7 @@ - (void)performDataProtectedMigrationIfNeeded {
118118
[defaults setBool:YES forKey:kDataProtectedMigrationCheckPerformedKey];
119119
}
120120

121-
#elif TARGET_OS_IOS
121+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
122122
// Migrate from GPPSignIn 1.x or GIDSignIn 1.0 - 4.x to the GTMAppAuth storage introduced in
123123
// GIDSignIn 5.0.
124124
- (void)performGIDMigrationIfNeededWithTokenURL:(NSURL *)tokenURL

GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ - (void)testMigrateIfNeeded_KeychainFailure_DataProtectedMigration {
184184
XCTAssertNotNil([_realLegacyGTMKeychainStore retrieveAuthSessionWithError:nil]);
185185
}
186186

187-
#else
187+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
188188
- (void)testMigrateIfNeeded_NoPreviousMigration_GTMAppAuthMigration {
189189
[[[_mockUserDefaults stub] andReturn:_mockUserDefaults] standardUserDefaults];
190190
[[[_mockUserDefaults expect] andReturnValue:@NO] boolForKey:kGTMAppAuthMigrationCheckPerformedKey];
@@ -249,7 +249,7 @@ - (void)testMigrateIfNeeded_HasPreviousMigration {
249249
#if TARGET_OS_OSX
250250
[[[_mockUserDefaults expect] andReturnValue:@YES] boolForKey:kDataProtectedMigrationCheckPerformedKey];
251251
[[_mockUserDefaults reject] setBool:YES forKey:kDataProtectedMigrationCheckPerformedKey];
252-
#else
252+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
253253
[[[_mockUserDefaults expect] andReturnValue:@YES] boolForKey:kGTMAppAuthMigrationCheckPerformedKey];
254254
[[_mockUserDefaults reject] setBool:YES forKey:kGTMAppAuthMigrationCheckPerformedKey];
255255
#endif // TARGET_OS_OSX
@@ -266,7 +266,7 @@ - (void)testMigrateIfNeeded_isFreshInstall {
266266
[[[_mockUserDefaults stub] andReturn:_mockUserDefaults] standardUserDefaults];
267267
#if TARGET_OS_OSX
268268
[[_mockUserDefaults expect] setBool:YES forKey:kDataProtectedMigrationCheckPerformedKey];
269-
#else
269+
#elif TARGET_OS_IOS && !TARGET_OS_MACCATALYST
270270
[[_mockUserDefaults expect] setBool:YES forKey:kGTMAppAuthMigrationCheckPerformedKey];
271271
#endif // TARGET_OS_OSX
272272

0 commit comments

Comments
 (0)