在一个XCode项目中使用两个GoogleService-Info.plist文件

6
我在我的iOS项目中使用Google登录和Google Firebase。因此,我生成了两个不同的GoogleService-Info.plist文件。如果我在一个项目中使用这两个文件,就会出现重复问题。
如何在单个项目中使用这两个文件?
非常感谢您的建议!

属性列表文件就像基于XML的文件一样,只需合并它们即可。 - antonio081014
1个回答

1

我使用以下方法,而不是使用FirebaseApp.configure()

private func configureFirebase() {
    guard   let plistPath = Bundle.main.path(forResource: "GoogleService-Info-Firebase", ofType: "plist"),
            let options =  FirebaseOptions(contentsOfFile: plistPath)
    else { return }
    FirebaseApp.configure(options: options)
}

因此,对于Firebase,您应该创建一个新文件,例如GoogleService-Info-Firebase.plist,并将其用于Firebase配置。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接