My application has four targets and I want to use Firebase in 3 of them. How can I do it ?
What I tried:
I create the podfile like this :
platform: iOS, '12.3'
use_frameworks!
def firebasePods
pod 'Firebase/Auth'
end
target 'Application' do
# Pods for Tinder1104
firebasePods
end
target 'FeatureX' do
# Pods for TinderiOSApp
firebasePods
end
target 'FeatureY' do
# Pods for TinderiOSApp
firebasePods
end
target 'FeatureZ' do
# Pods for TinderiOSApp
end
I put the GoogleService-Info.plist
file in the Application target. The app runs but I got warnings on the console, it's similar to this post:
Class X is implemented in both <framework> and <application> one of the two will be used, which one is undefined
And My app cannot connect to Firebase server even I added initialization code FirebaseApp.configure()
. Then when I try to use Auth, my app crashes because of reason:
The default FIRApp instance must be configured before the default FIRAuthinstance can be initialized.
One way to ensure that is to call `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) in the App Delegate's `application:didFinishLaunchingWithOptions:`
(`application(_:didFinishLaunchingWithOptions:)` in Swift).