我在单个iOS应用中配置了多个firebase数据库。
这是我的AppDelegate中的代码,它选择我必须在运行时选择哪个firebase数据库
func initFirebase(){
// Check the Flag which Firebase to connect with
if (UserDefaultsManager().getFirebaseConfiguration()){
let resource = UserDefaultsManager.env_firebase?.value(forKey: "resource") as! String
print("resource \(resource)")
let filePath = Bundle.main.path(forResource: resource, ofType:"plist")
let options = FirebaseOptions(contentsOfFile:filePath!)
FirebaseApp.configure(options: options!)
}
}
这一切都很好。
问题在于崩溃报告,我还必须使firebase崩溃报告动态化。
现在我已经使用jBackend-genetech-dev-crash-reporting.json
配置了我的firebase崩溃报告,这是我的崩溃报告shell脚本。
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist (its my genetech-dev firebase service account actually) file
GOOGLE_APP_ID=1:740631780656:ios:ddccc74c2f726b3a
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}/JamesApp/jBackend-genetech-dev-crash-reporting.json"
所以,当我使用服务帐户GoogleService-Info.plist
中定义的配置将我的应用程序连接到firebase数据库时,它的工作完美无缺,即我收到崩溃报告,其中包含崩溃的确切行号。这是截图。
但每当我与其他firebase帐户示例GoogleService-Info-mh6-prod.plist
建立联系时,我也会收到此案例中的崩溃报告,但是no Line number
,请参阅下面的截图。
更多信息
我在真实设备上进行测试吗?是
我的项目中是否禁用了bitcode支持?是
问题:
如何在我的案例中使我的崩溃报告脚本动态化。 我已经看过这个iOS Firebase Crash Reporting - Error running build script,即根据应用程序配置变量(即release / debug)使脚本动态化。但我的情况不同,我的应用程序根据应用程序的系统设置包选择firebase数据库。看下面的截图。