@@ -72,45 +72,6 @@ @implementation FIRFirestore {
72
72
FIRFirestoreSettings *_settings;
73
73
}
74
74
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
-
114
75
+ (instancetype )firestore {
115
76
FIRApp *app = [FIRApp defaultApp ];
116
77
if (!app) {
0 commit comments