Kaushik
Kaushik

Reputation: 981

React-Native: How to add multiple google-service-info plist files for one build for dynamic links?

In my iOS app I use Firebase Dynamic Urls for sharing any posts from within the app. So I have a setup in the firebase, that generates dynamic links every time for me.

Now I want to separate out user created dynamic links and marketing team dynamic links to make them look more professional.

So when I setup again, I got a google-service-info-plist file with the new dynamic link setup. But I can only include one from xcode.

How can I have multiple of them to support on ios

Upvotes: 0

Views: 1800

Answers (1)

khalil nouisser
khalil nouisser

Reputation: 11

for Swift 2.3:

let filePath = NSBundle.mainBundle().pathForResource("GoogleService-Info", ofType: "plist")
let options = FIROptions(contentsOfFile: filePath)
FIRApp.configureWithOptions(options)

for Swift 3.0:

let filePath = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")!
let options = FIROptions(contentsOfFile: filePath)
FIRApp.configure(with: options)

for Swift 4.0:

let filePath = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")!
let options = FirebaseOptions(contentsOfFile: filePath)
FirebaseApp.configure(options: options!)

Upvotes: 1

Related Questions