Slide 14
Slide 14 text
補⾜: 環境ごとに設定を分ける⽅法
let options = FirebaseOptions(
contentsOfFile: FirebaseConfig.resourceFilePath())!
FirebaseApp.configure(options: options)
AppDelegate内
struct FirebaseConfig {
static func resourceFilePath() -> String {
#if DEBUG
return Bundle.main.path(forResource:
"GoogleService-development-Info", ofType: ".plist")!
#else
return Bundle.main.path(forResource:
"GoogleService-Info", ofType: ".plist")!
#endif
}
}
Config
参考: https://qiita.com/giiiita/items/be71c14a59f596bc4001
QAやデバッグ⽤のパラメータを設定可能なので便利