Skip to content

Commit e4f05d3

Browse files
Add GMPID header to the RTDB SDK (#5761)
1 parent 851b039 commit e4f05d3

File tree

15 files changed

+34
-6
lines changed

15 files changed

+34
-6
lines changed

Example/Database/Tests/Helpers/FIRFakeApp.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
@interface FIRFakeOptions : NSObject
2424
@property(nonatomic, readonly, copy) NSString *databaseURL;
25+
@property(nonatomic, readonly, copy) NSString *googleAppID;
2526
- (instancetype)initWithURL:(NSString *)url;
2627
@end
2728

@@ -30,6 +31,7 @@ - (instancetype)initWithURL:(NSString *)url {
3031
self = [super init];
3132
if (self) {
3233
_databaseURL = url;
34+
_googleAppID = @"fake-app-id";
3335
}
3436
return self;
3537
}

Example/Database/Tests/Helpers/FTestHelpers.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ + (FIRDatabaseConfig *)configForName:(NSString *)name {
5858
id<FIRAuthInterop> auth = [[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:nil];
5959
id<FAuthTokenProvider> authTokenProvider = [FAuthTokenProvider authTokenProviderWithAuth:auth];
6060
return [[FIRDatabaseConfig alloc] initWithSessionIdentifier:name
61+
googleAppID:@"fake-app-id"
6162
authTokenProvider:authTokenProvider];
6263
}
6364

Example/Database/Tests/Integration/FConnectionTest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ - (void)XXXtestObtainSessionId {
5959
FRepoInfo *info = [[FRepoInfo alloc] initWithHost:host isSecure:YES withNamespace:@"default"];
6060
FConnection *conn = [[FConnection alloc] initWith:info
6161
andDispatchQueue:[FIRDatabaseQuery sharedQueue]
62+
googleAppID:@"fake-app-id"
6263
lastSessionID:nil];
6364
FTestConnectionDelegate *delegate = [[FTestConnectionDelegate alloc] init];
6465

Firebase/Database/Api/FIRDatabaseComponent.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ - (FIRDatabase *)databaseForApp:(FIRApp *)app URL:(NSString *)url {
157157

158158
FIRDatabaseConfig *config = [[FIRDatabaseConfig alloc]
159159
initWithSessionIdentifier:sessionIdentifier
160+
googleAppID:app.options.googleAppID
160161
authTokenProvider:authTokenProvider];
161162
database = [[FIRDatabase alloc] initWithApp:app
162163
repoInfo:parsedUrl.repoInfo

Firebase/Database/Api/FIRDatabaseConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
2626
@interface FIRDatabaseConfig : NSObject
2727

2828
- (id)initWithSessionIdentifier:(NSString *)identifier
29+
googleAppID:(NSString *)googleAppID
2930
authTokenProvider:(id<FAuthTokenProvider>)authTokenProvider;
3031

3132
/**

Firebase/Database/Api/FIRDatabaseConfig.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
@interface FIRDatabaseConfig (Private)
2424

2525
@property(nonatomic, strong, readwrite) NSString *sessionIdentifier;
26+
@property(nonatomic, strong, readwrite) NSString *googleAppID;
2627

2728
@end
2829

@@ -35,11 +36,13 @@ - (id)init {
3536
}
3637

3738
- (id)initWithSessionIdentifier:(NSString *)identifier
39+
googleAppID:(NSString *)googleAppID
3840
authTokenProvider:(id<FAuthTokenProvider>)authTokenProvider {
3941
self = [super init];
4042
if (self != nil) {
4143
self->_sessionIdentifier = identifier;
4244
self->_callbackQueue = dispatch_get_main_queue();
45+
self->_googleAppID = googleAppID;
4346
self->_persistenceCacheSizeBytes =
4447
10 * 1024 * 1024; // Default cache size is 10MB
4548
self->_authTokenProvider = authTokenProvider;

Firebase/Database/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# v6.2.2
22
- [fixed] Addressed crash that prevented the SDK from opening when the versioning file was
33
corrupted. (#5686)
4+
- [changed] Added internal HTTP header to the WebChannel connection.
5+
46

57
# v6.2.1
68
- [fixed] Fixed documentation typos. (#5406, #5418)

Firebase/Database/Core/FPersistentConnection.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ - (void)openNetworkConnectionWithToken:(NSString *)token {
511511
self->connectionState = ConnectionStateConnecting;
512512
self.realtime = [[FConnection alloc] initWith:self.repoInfo
513513
andDispatchQueue:self.dispatchQueue
514+
googleAppID:self.config.googleAppID
514515
lastSessionID:self.lastSessionID];
515516
self.realtime.delegate = self;
516517
[self.realtime open];

Firebase/Database/FIRDatabaseConfig_Private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
@property(nonatomic, readonly) BOOL isFrozen;
2525
@property(nonatomic, strong, readonly) NSString *sessionIdentifier;
26+
@property(nonatomic, strong, readonly) NSString *googleAppID;
2627
@property(nonatomic, strong) id<FAuthTokenProvider> authTokenProvider;
2728
@property(nonatomic, strong) id<FStorageEngine> forceStorageEngine;
2829

Firebase/Database/Realtime/FConnection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
- (id)initWith:(FRepoInfo *)aRepoInfo
2828
andDispatchQueue:(dispatch_queue_t)queue
29+
googleAppID:(NSString *)googleAppID
2930
lastSessionID:(NSString *)lastSessionID;
3031

3132
- (void)open;

0 commit comments

Comments
 (0)