'Firebase Services as library module
Is there a way to use Firebase services in a library/module? I am planning of creating a module for Firebase only, I know that Firebase services need FirebaseApp
instance to identify the app client but I wonder if there is a possibility of creating a module that consist of Firebase product only which then can be consume in app level
Solution 1:[1]
I already managed to do this, the idea is Firebase SDK is in a submodule which contains your common use case, extension function, etc that you might want to reuse like a template whenever you are working on a new project that has Firebase services. The app module will still be responsible for initializing your Firebase services in Application class like this.
FirebaseApp.initializeApp(this)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bitwise DEVS |