|
85 | 85 |
|
86 | 86 | @interface FIRApp ()
|
87 | 87 |
|
88 |
| -@property(nonatomic) BOOL alreadySentConfigureNotification; |
89 |
| - |
90 |
| -@property(nonatomic) BOOL alreadySentDeleteNotification; |
91 |
| - |
92 | 88 | #ifdef DEBUG
|
93 | 89 | @property(nonatomic) BOOL alreadyOutputDataCollectionFlag;
|
94 | 90 | #endif // DEBUG
|
@@ -147,22 +143,13 @@ + (void)configureWithOptions:(FIROptions *)options {
|
147 | 143 | + (void)configureDefaultAppWithOptions:(FIROptions *)options
|
148 | 144 | sendingNotifications:(BOOL)sendNotifications {
|
149 | 145 | if (sDefaultApp) {
|
150 |
| - // FIRApp sets up FirebaseAnalytics and does plist validation, but does not cause it |
151 |
| - // to fire notifications. So, if the default app already exists, but has not sent out |
152 |
| - // configuration notifications, then continue re-initializing it. |
153 |
| - if (!sendNotifications || sDefaultApp.alreadySentConfigureNotification) { |
154 |
| - [NSException raise:kFirebaseCoreErrorDomain |
155 |
| - format:@"Default app has already been configured."]; |
156 |
| - } |
| 146 | + [NSException raise:kFirebaseCoreErrorDomain format:@"Default app has already been configured."]; |
157 | 147 | }
|
158 | 148 | @synchronized(self) {
|
159 | 149 | FIRLogDebug(kFIRLoggerCore, @"I-COR000001", @"Configuring the default app.");
|
160 | 150 | sDefaultApp = [[FIRApp alloc] initInstanceWithName:kFIRDefaultAppName options:options];
|
161 | 151 | [FIRApp addAppToAppDictionary:sDefaultApp];
|
162 |
| - if (!sDefaultApp.alreadySentConfigureNotification && sendNotifications) { |
163 |
| - [FIRApp sendNotificationsToSDKs:sDefaultApp]; |
164 |
| - sDefaultApp.alreadySentConfigureNotification = YES; |
165 |
| - } |
| 152 | + [FIRApp sendNotificationsToSDKs:sDefaultApp]; |
166 | 153 | }
|
167 | 154 | }
|
168 | 155 |
|
@@ -196,10 +183,7 @@ + (void)configureWithName:(NSString *)name options:(FIROptions *)options {
|
196 | 183 | FIRLogDebug(kFIRLoggerCore, @"I-COR000002", @"Configuring app named %@", name);
|
197 | 184 | FIRApp *app = [[FIRApp alloc] initInstanceWithName:name options:options];
|
198 | 185 | [FIRApp addAppToAppDictionary:app];
|
199 |
| - if (!app.alreadySentConfigureNotification) { |
200 |
| - [FIRApp sendNotificationsToSDKs:app]; |
201 |
| - app.alreadySentConfigureNotification = YES; |
202 |
| - } |
| 186 | + [FIRApp sendNotificationsToSDKs:app]; |
203 | 187 | }
|
204 | 188 | }
|
205 | 189 |
|
@@ -259,13 +243,10 @@ - (void)deleteApp:(FIRAppVoidBoolCallback)completion {
|
259 | 243 | if ([self.name isEqualToString:kFIRDefaultAppName]) {
|
260 | 244 | sDefaultApp = nil;
|
261 | 245 | }
|
262 |
| - if (!self.alreadySentDeleteNotification) { |
263 |
| - NSDictionary *appInfoDict = @{kFIRAppNameKey : self.name}; |
264 |
| - [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppDeleteNotification |
265 |
| - object:[self class] |
266 |
| - userInfo:appInfoDict]; |
267 |
| - self.alreadySentDeleteNotification = YES; |
268 |
| - } |
| 246 | + NSDictionary *appInfoDict = @{kFIRAppNameKey : self.name}; |
| 247 | + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppDeleteNotification |
| 248 | + object:[self class] |
| 249 | + userInfo:appInfoDict]; |
269 | 250 | completion(YES);
|
270 | 251 | } else {
|
271 | 252 | FIRLogError(kFIRLoggerCore, @"I-COR000007", @"App does not exist.");
|
@@ -296,10 +277,6 @@ - (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)opti
|
296 | 277 | _options.editingLocked = YES;
|
297 | 278 | _isDefaultApp = [name isEqualToString:kFIRDefaultAppName];
|
298 | 279 | _container = [[FIRComponentContainer alloc] initWithApp:self];
|
299 |
| - |
300 |
| - FIRApp *app = sAllApps[name]; |
301 |
| - _alreadySentConfigureNotification = app.alreadySentConfigureNotification; |
302 |
| - _alreadySentDeleteNotification = app.alreadySentDeleteNotification; |
303 | 280 | }
|
304 | 281 | return self;
|
305 | 282 | }
|
|
0 commit comments