| java.lang.Object | |
| ↳ | com.google.firebase.FirebaseApp |
The entry point of Firebase SDKs. It holds common configuration and state for Firebase APIs. Most applications don't need to directly interact with FirebaseApp.
Firebase APIs use the default FirebaseApp by default, unless a different one is explicitly passed to the API via FirebaseFoo.getInstance(firebaseApp).
The default app instance is initialized on app startup by
FirebaseInitProvider. This is added to the app's manifest by
Gradle manifest merging. If the app is using a different build system the provider needs to be
manually added to the app's manifest.
Alternatively initializeApp(Context, FirebaseOptions) initializes the default
app instance. This method should be invoked from Application. This is also
necessary if it is used outside of the application's main process.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | DEFAULT_APP_NAME | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the application
Context. | |||||||||||
Returns a mutable list of all FirebaseApps.
| |||||||||||
Returns the instance identified by the unique name, or throws if it does not exist.
| |||||||||||
Returns the default (first initialized) instance of the
FirebaseApp. | |||||||||||
Returns the unique name of this app.
| |||||||||||
Returns the specified
FirebaseOptions. | |||||||||||
A factory method to intialize a
FirebaseApp. | |||||||||||
Initializes the default
FirebaseApp instance. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Returns a mutable list of all FirebaseApps.
Returns the instance identified by the unique name, or throws if it does not exist.
| name | represents the name of the FirebaseApp instance. |
|---|
| IllegalStateException | if the FirebaseApp was not initialized, either via
initializeApp(Context, FirebaseOptions, String).
|
|---|
Returns the default (first initialized) instance of the FirebaseApp.
| IllegalStateException | if the default app was not initialized. |
|---|
Returns the unique name of this app.
A factory method to intialize a FirebaseApp.
| context | represents the Context |
|---|---|
| options | represent the global FirebaseOptions |
| name | unique name for the app. It is an error to initialize an app with an already existing name. Starting and ending whitespace characters in the name are ignored (trimmed). |
FirebaseApp
| IllegalStateException | if an app with the same name but different parameters was already initialized. |
|---|
Initializes the default FirebaseApp instance. Same as
initializeApp(Context, FirebaseOptions), but it uses DEFAULT_APP_NAME as
name.
The creation of the default instance is automatically triggered at app startup time, if Firebase configuration values are available from resources - populated from google-services.json.