在单个 XCode 项目中使用两个 GoogleService-Info.plist

Man*_*nan 5 google-login ios firebase

我在我的 iOS 项目中使用 Google 登录和 Google Firebase。所以我生成了两个不同的 GoogleService-Info.plist 文件。如果我在项目下使用这两个文件,则会出现重复问题。

如何在单个项目中使用这两个文件?

所有建议表示赞赏!

Vla*_*bir 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)
}
Run Code Online (Sandbox Code Playgroud)

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