Skip to content

Commit b1c5428

Browse files
authored
[Auth] Added note to getStoredUser(forAccessGroup:) documentation about tvOS keychain sharing issues (#9244)
* Add note about tvOS keychain sharing issue * Update Auth CHANGELOG * Review * Log error when running on tvOS and sharing auth state * Update API docs * Update changelog * Style * Improve message clarity * Style * Review 2 * Review 3
1 parent 4a6892c commit b1c5428

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

FirebaseAuth/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v8.12.0
2+
- [added] Added documentation note and error logging to `getStoredUser(forAccessGroup:)` regarding tvOS keychain sharing issues. (#8878)
3+
14
# v8.11.0
25
- [changed] Added a `X-Firebase-GMPID` header to network requests. (#9046)
36
- [fixed] Added multi-tenancy support to generic OAuth providers. (#7990)

FirebaseAuth/Sources/Auth/FIRAuth.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,16 @@ - (nullable FIRUser *)getStoredUserForAccessGroup:(NSString *_Nullable)accessGro
22612261
#endif // TARGET_OS_WATCH
22622262
user = [unarchiver decodeObjectOfClass:[FIRUser class] forKey:userKey];
22632263
} else {
2264+
#if TARGET_OS_TV
2265+
if (self.shareAuthStateAcrossDevices) {
2266+
FIRLogError(kFIRLoggerAuth, @"I-AUT000001",
2267+
@"Getting a stored user for a given access group is not supported "
2268+
@"on tvOS when `shareAuthStateAcrossDevices` is set to `true` (#8878)."
2269+
@"This case will return `nil`.");
2270+
return nil;
2271+
}
2272+
#endif // TARGET_OS_TV
2273+
22642274
user = [self.storedUserManager getStoredUserForAccessGroup:accessGroup
22652275
shareAuthStateAcrossDevices:self.shareAuthStateAcrossDevices
22662276
projectIdentifier:self.app.options.APIKey

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ NS_SWIFT_NAME(Auth)
857857

858858
/** @fn getStoredUserForAccessGroup:error:
859859
@brief Get the stored user in the given accessGroup.
860+
@note This API is not supported on tvOS when `shareAuthStateAcrossDevices` is set to `true`.
861+
This case will return `nil`.
862+
Please refer to https://github.com/firebase/firebase-ios-sdk/issues/8878 for details.
860863
*/
861864
- (nullable FIRUser *)getStoredUserForAccessGroup:(NSString *_Nullable)accessGroup
862865
error:(NSError *_Nullable *_Nullable)outError;

0 commit comments

Comments
 (0)