multiple GoogleService-Info support

前端 未结 2 2031
别跟我提以往
别跟我提以往 2020-12-11 21:31

I registered my Dev and Prod schemes as different apps in Firebase. I want them to be separate, Each has unique bundle ID. I am using #if dev to identify if it is dev or pro

2条回答
  •  星月不相逢
    2020-12-11 21:38

    use

    var firebasePlist: String? = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")
    if development == true{
    firebasePlist = Bundle.main.path(forResource: "GoogleService-Info-DEV", ofType: "plist")
    }
    var options = FIROptions(contentsOfFile: firebasePlist)
    FIRApp.configure(with: options)
    

    but you'll have to have a variable called development with the value of true when you want to use the DEV GoogleService plist and the value of false is you want to use the regular GoogleService plist

提交回复
热议问题