Search code examples
iosfirebasecocoapods

Adding Firebase to Pod project


I was wondering if someone was able to integrate successfully FireBase SDK into his Pod project.

The Firebase documentation at https://firebase.google.com/docs/analytics/ios/start?authuser=3 only shows how to add it to Application.

In more details: The Firebase initialization is tide to the Application life cycle, which is outside of the scope of the Pod. Initializing in the Pod "main" view controller may result in bad SDK behavior.


Solution

  • Well, this is absolutely possible. Initialization should occur in any UIViewController whats so ever.

    The big no-no when adding common analytics libraries in an SDK/POD/MODULE project is that it's going to override the parenting app configuration!.

    Currently, Firebase has a single configuration per app execution, meaning that it can work just with a single APP_ID, and it should definitely be the one of the parenting app.