Skip to content

Commit 7e3786b

Browse files
committed
Merge branch 'master' into wilhuff/merge
2 parents 706ce02 + fc1ebb8 commit 7e3786b

File tree

3 files changed

+5
-44
lines changed

3 files changed

+5
-44
lines changed

CocoapodsIntegrationTest/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
source "https://rubygems.org"
44

5-
gem 'cocoapods', "~>1.7.0.beta"
5+
gem 'cocoapods', "!=1.7.0.rc.1"

Example/Core/Tests/FIRAppTest.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ - (void)testAnalyticsSetByGlobalDataCollectionSwitch {
653653

654654
id configurationMock = OCMClassMock([FIRAnalyticsConfiguration class]);
655655
OCMStub([configurationMock sharedInstance]).andReturn(configurationMock);
656-
OCMStub([configurationMock setAnalyticsCollectionEnabled:OCMOCK_ANY persistSetting:OCMOCK_ANY]);
657656

658657
// Ensure Analytics is set after the global flag is set. It needs to
659658
[defaultApp setDataCollectionDefaultEnabled:YES];
@@ -671,14 +670,15 @@ - (void)testAnalyticsNotSetByGlobalDataCollectionSwitch {
671670

672671
id configurationMock = OCMClassMock([FIRAnalyticsConfiguration class]);
673672
OCMStub([configurationMock sharedInstance]).andReturn(configurationMock);
674-
OCMStub([configurationMock setAnalyticsCollectionEnabled:OCMOCK_ANY persistSetting:OCMOCK_ANY]);
675673

676674
// Reject any changes to Analytics when the data collection changes.
675+
OCMReject([configurationMock setAnalyticsCollectionEnabled:YES persistSetting:YES]);
676+
OCMReject([configurationMock setAnalyticsCollectionEnabled:YES persistSetting:NO]);
677677
[app setDataCollectionDefaultEnabled:YES];
678-
OCMReject([configurationMock setAnalyticsCollectionEnabled:OCMOCK_ANY persistSetting:OCMOCK_ANY]);
679678

679+
OCMReject([configurationMock setAnalyticsCollectionEnabled:NO persistSetting:YES]);
680+
OCMReject([configurationMock setAnalyticsCollectionEnabled:NO persistSetting:NO]);
680681
[app setDataCollectionDefaultEnabled:NO];
681-
OCMReject([configurationMock setAnalyticsCollectionEnabled:OCMOCK_ANY persistSetting:OCMOCK_ANY]);
682682
}
683683

684684
#pragma mark - Internal Methods

Firestore/Source/API/FIRFirestore.mm

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -72,45 +72,6 @@ @implementation FIRFirestore {
7272
FIRFirestoreSettings *_settings;
7373
}
7474

75-
+ (NSMutableDictionary<NSString *, FIRFirestore *> *)instances {
76-
static dispatch_once_t token = 0;
77-
static NSMutableDictionary<NSString *, FIRFirestore *> *instances;
78-
dispatch_once(&token, ^{
79-
instances = [NSMutableDictionary dictionary];
80-
});
81-
return instances;
82-
}
83-
84-
+ (void)initialize {
85-
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
86-
[center addObserverForName:kFIRAppDeleteNotification
87-
object:nil
88-
queue:nil
89-
usingBlock:^(NSNotification *_Nonnull note) {
90-
NSString *appName = note.userInfo[kFIRAppNameKey];
91-
if (appName == nil) return;
92-
93-
NSMutableDictionary *instances = [self instances];
94-
@synchronized(instances) {
95-
// Since the key for instances isn't just the app name, iterate over all the
96-
// keys to get the one(s) we have to delete. There could be multiple in case
97-
// the user calls firestoreForApp:database:.
98-
NSMutableArray *keysToDelete = [[NSMutableArray alloc] init];
99-
NSString *keyPrefix = [NSString stringWithFormat:@"%@|", appName];
100-
for (NSString *key in instances.allKeys) {
101-
if ([key hasPrefix:keyPrefix]) {
102-
[keysToDelete addObject:key];
103-
}
104-
}
105-
106-
// Loop through the keys found and delete them from the stored instances.
107-
for (NSString *key in keysToDelete) {
108-
[instances removeObjectForKey:key];
109-
}
110-
}
111-
}];
112-
}
113-
11475
+ (instancetype)firestore {
11576
FIRApp *app = [FIRApp defaultApp];
11677
if (!app) {

0 commit comments

Comments
 (0)