i使从Firebase Remote Config Store获取配置的功能。 但是我得到了一些钥匙的价值。 因此,我调试了获取值并找到singleton实例的remoteconfig点地址0x00000000 ..的过程。如果我打印此对象应用程序崩溃并显示错误“不良访问”。我不知道为什么会发生这种情况,因为我遵循了Firebase Docs提供的所有程序。 如果您遇到我同样的问题,请帮助我。 在启动之前,我在启动之前打电话以下。
func configureFirebase() {
FirebaseApp.configure()
// Setup remote config
do {
let settings = RemoteConfigSettings()
let config = RemoteConfig.remoteConfig()
config.configSettings = settings
try config.setDefaults(from: [
"alarm_mission_type": "shake_mission"
])
config.fetchAndActivate()
} catch {
debugPrint("Remote config 기본값 설정 오류 \(error.localizedDescription)")
}
}
代码下面使用配置值代码。
let config = RemoteConfig.remoteConfig()
config.fetchAndActivate()
let configValue = config["alarm_mission_type"].stringValue
print(config) // app crashed and showed error "bad access"
我自己,
FRAMWORK的组件文件在行动上不直接使用,因此请在tuist中构建设置忽略组件文件。因此注册不起作用。
因此,我们应该添加其他链接标志字段一个值'-OBJC'。此标志在静态库中编译了Expicable的Objective-C文件。