在单个XCode项目中使用两个GoogleService-Info.plist [英] Use Two GoogleService-Info.plist in a single XCode project
本文介绍了在单个XCode项目中使用两个GoogleService-Info.plist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的iOS项目中使用Google登录名和Google Firebase.因此,我生成了两个不同的GoogleService-Info.plist文件.如果在项目下使用这两个文件,则会出现重复问题.
I'm using Google Login and Google Firebase in my iOS Project. So I generated two different GoogleService-Info.plist files. If I use those two files under a project I got duplicate issue.
如何在单个项目中使用这两个文件?
How to use these two files in a single project?
感谢所有建议!
推荐答案
不是使用FirebaseApp.configure()
,而是使用以下方法:
Instead of using FirebaseApp.configure()
I use this method:
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配置.
So, for firebase you should create a new file e.g. GoogleService-Info-Firebase.plist
and use it for Firebase configuration.
这篇关于在单个XCode项目中使用两个GoogleService-Info.plist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文