Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Extension - Fatal Exception: com.firebase.core Default app has already been configured

iOS Extension - Fatal Exception: com.firebase.core Default app has already been configured.

I run the Fir.configure() in the viewDidLoad() method and some events pass and get through to Firebase.

Can someone help me figure this out.. Google is not friendly enough.

PS: Yes I created a second .plist, and a second app in Firebase Console. PPS: Yes I selected the correct target for each GoogleServices plist

I'm seeking the solution..

like image 589
Stefan Avatar asked Jul 22 '16 22:07

Stefan


2 Answers

I don't know if you're still looking for a solution but I had the same issue, using firebase with extension.

I ended up doing this :

if(FIRApp.defaultApp() == nil){
    FIRApp.configure()
}

This will check if the app is already configured so that there is no crash.

like image 56
Didier Nizard Avatar answered Oct 05 '22 14:10

Didier Nizard


I had the same issue and I resolved it by making changes in two places in my application (check your syntax for swift version):

  1. In AppDelegate.swift override a following method:

    override init() { FirebaseApp.configure() }

  2. In your ViewController.swift's viewDidLoad() method, write this code:

    if FirebaseApp.app() == nil {
        FirebaseApp.configure()
    }
    
like image 32
Ashvini Avatar answered Oct 05 '22 15:10

Ashvini