Terminating app due to uncaught exception 'FIRAppNotConfigured'

Viewed 83

We have integrated FirebasePerformance and RemoteConfig SDK in our application using the following doc https://firebase.google.com/docs/perf-mon/disable-sdk?platform=ios. As per the document, we added the remote config value before [FIRApp configure];. But it creates a crash issue

2022-06-22 21:27:01.049448+0530 Axis Mobile[925:112552] *** Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'The default FirebaseApp instance must be configured before the default Remote Config instance can be initialized. One way to ensure this is to call FirebaseApp.configure() in the App Delegate's application(_:didFinishLaunchingWithOptions:) or the @main struct's initializer in SwiftUI.'

enter image description here

This is our implementation code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.remoteConfig = [FIRRemoteConfig remoteConfig];
FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] init];
remoteConfigSettings.minimumFetchInterval = 0;
self.remoteConfig.configSettings = remoteConfigSettings;
[self.remoteConfig setDefaultsFromPlistFileName:@"RemoteConfigDefaults"];
[FIRPerformance sharedInstance].instrumentationEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRPerformance sharedInstance].dataCollectionEnabled = ![self.remoteConfig configValueForKey:@"perf_disable"].boolValue;
[FIRApp configure];
return YES;

}

If we add [FIRApp configure] as the initial app has not crashed. But [FIRPerformance sharedInstance].instrumentationEnabled blocking some API response. Kindly help me resolve this. Thanks in advance.

0 Answers
Related