我们使用以下doc 。根据文档,我们在[FIRAPP配置]之前添加了远程配置值;。但这会引起崩溃问题
2022-06-22 21:27:01.049448+0530 Axis Mobile [925:112552] ***由于未知的例外'FirappNotConfigured'终止应用程序,原因:'在可以初始化默认远程配置实例之前进行配置。确保这是在应用程序代表的 application(_:didfinishlaunchingwithoptions:)
@main struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> struct> swiftui中的初始化器。'
这是我们的实现代码
- (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;
}
如果我们添加[FIRAPP配置],因为初始应用程序尚未崩溃。但是[Firperformance sharedInstance] InsTrumentationEnabled阻止了一些API响应。请帮助我解决这个问题。提前致谢。
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.'

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.
发布评论