aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
diff options
context:
space:
mode:
authorGravatar Zsika Phillip <protocol86@users.noreply.github.com>2017-09-12 18:29:44 -0700
committerGravatar GitHub <noreply@github.com>2017-09-12 18:29:44 -0700
commit660f62778ab246c66da5442bc3bd8dadf301b328 (patch)
tree168625107739c69904017090318c53e86c4afa80 /Firebase/Auth/Source/RPCs/FIRAuthBackend.m
parent1c44d3914609c4253f8d046f0671059de5219b1c (diff)
Adds ability to track Firebase Auth UI per request (#251)
* Adds ability to track Firebase Auth UI per request Adds internal method to FIRAuth which will be accessed in Auth UI via an extension. Example request header header with Firebase Auth Core Marker: X-Client-Version: iOS/FirebaseSDK/0.1.1/FirebaseCore-iOS
Diffstat (limited to 'Firebase/Auth/Source/RPCs/FIRAuthBackend.m')
-rw-r--r--Firebase/Auth/Source/RPCs/FIRAuthBackend.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/Firebase/Auth/Source/RPCs/FIRAuthBackend.m b/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
index 2a70a80..2442882 100644
--- a/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
+++ b/Firebase/Auth/Source/RPCs/FIRAuthBackend.m
@@ -76,6 +76,11 @@ static NSString *const kIosBundleIdentifierHeader = @"X-Ios-Bundle-Identifier";
*/
static NSString *const kFirebaseLocalHeader = @"X-Firebase-Locale";
+/** @var kFirebaseAuthCoreFrameworkMarker
+ @brief The marker in the HTTP header that indicates the request comes from Firebase Auth Core.
+ */
+static NSString *const kFirebaseAuthCoreFrameworkMarker = @"FirebaseCore-iOS";
+
/** @var kJSONContentType
@brief The value of the HTTP content-type header for JSON payloads.
*/
@@ -499,8 +504,11 @@ static id<FIRAuthBackendImplementation> gBackendImplementation;
NSError *_Nullable))handler {
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
- NSString *clientVersion =
- [NSString stringWithFormat:@"iOS/FirebaseSDK/%s", FirebaseAuthVersionString];
+ NSString *additionalFrameworkMarker = requestConfiguration.additionalFrameworkMarker ?:
+ kFirebaseAuthCoreFrameworkMarker;
+ NSString *clientVersion = [NSString stringWithFormat:@"iOS/FirebaseSDK/%s/%@",
+ FirebaseAuthVersionString,
+ additionalFrameworkMarker];
[request setValue:clientVersion forHTTPHeaderField:kClientVersionHeader];
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
[request setValue:bundleID forHTTPHeaderField:kIosBundleIdentifierHeader];