Use more than one Firebase database in single app - Swift

后端 未结 2 1420
我在风中等你
我在风中等你 2021-02-08 13:08

I have a firebase database currently connected to my app with the GoogleService-Info.plist, etc. It works great.

I would like to connect my app to a second firebase data

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 13:56

    With the newest version of Firebase you should do:

    let filePath = Bundle.main.path(forResource: "My-GoogleService", ofType: "plist")
    guard let fileopts = FirebaseOptions.init(contentsOfFile: filePath!)
          else { assert(false, "Couldn't load config file") }
    FirebaseApp.configure(options: fileopts)
    

提交回复
热议问题