Skip to content

Commit 620a189

Browse files
authored
Merge pull request #340 from firebase/auth-server-logging
Logs the presence of Firebase Auth UI in Auth server requests.
2 parents dc3b311 + da8097b commit 620a189

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

FirebaseAuthUI/FUIAuth.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@
4444
*/
4545
static NSString *const kErrorUserInfoEmailKey = @"FIRAuthErrorUserInfoEmailKey";
4646

47+
/** @var kFirebaseAuthUIFrameworkMarker
48+
@brief The marker in the HTTP header that indicates the presence of Firebase Auth UI.
49+
*/
50+
static NSString *const kFirebaseAuthUIFrameworkMarker = @"FirebaseUI-iOS";
51+
52+
/** @category FIRAuth(InternalInterface)
53+
@brief Redeclares the internal interface not publicly exposed in FIRAuth.
54+
*/
55+
@interface FIRAuth (InternalInterface)
56+
57+
/** @property additionalFrameworkMarker
58+
@brief Additional framework marker that will be added as part of the header of every request.
59+
*/
60+
@property(nonatomic, copy, nullable) NSString *additionalFrameworkMarker;
61+
62+
@end
63+
4764
@interface FUIAuth ()
4865

4966
/** @fn initWithAuth:
@@ -72,6 +89,9 @@ + (nullable FUIAuth *)authUIWithAuth:(FIRAuth *)auth {
7289
authUI = [[FUIAuth alloc] initWithAuth:auth];
7390
objc_setAssociatedObject(auth, &kAuthAssociationKey, authUI,
7491
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
92+
if ([auth respondsToSelector:@selector(setAdditionalFrameworkMarker:)]) {
93+
auth.additionalFrameworkMarker = kFirebaseAuthUIFrameworkMarker;
94+
}
7595
}
7696
return authUI;
7797
}

0 commit comments

Comments
 (0)