Firebase. FirebaseApp
Firebase application object.
Summary
FirebaseApp acts as a conduit for communication between all Firebase services used by an application. A default instance is created automatically, based on settings in your Firebase configuration file, and all of the Firebase APIs connect with it automatically.
Inheritance
Inherits from: SystemIDisposable
Properties |
|
---|---|
DefaultInstance
|
static FirebaseApp
Get the default FirebaseApp instance.
|
DefaultName
|
static string
Gets the default name for FirebaseApp objects.
|
LogLevel
|
static LogLevel
Gets or sets the minimum log verbosity level for Firebase features.
|
Name
|
string
Get the name of this App instance.
|
Options
|
Get the AppOptions the FirebaseApp was created with.
|
Public functions |
|
---|---|
Dispose()
|
void
|
Public static functions |
|
---|---|
CheckAndFixDependenciesAsync()
|
Asynchronously checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state and attempts to fix them if they are not.
|
CheckDependencies()
|
Deprecated.
This method can run very slow on the main thread and will be removed in a future version. Use CheckDependenciesAsync() instead. Checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state. |
CheckDependenciesAsync()
|
Asynchronously checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state.
|
Create()
|
Initializes the default FirebaseApp with default options.
|
Create(AppOptions options)
|
Initializes the default FirebaseApp with the given options.
|
Create(AppOptions options, string name)
|
Initializes a FirebaseApp with the given options that operate on the named app.
|
FixDependenciesAsync()
|
Attempts to fix any missing dependencies that would prevent Firebase from working on the system.
|
GetInstance(string name)
|
Get an instance of an app by name.
|
Properties
DefaultInstance
static FirebaseApp DefaultInstance
Get the default FirebaseApp instance.
Details | |
---|---|
Returns |
Reference to the default app, if it hasn't been created this method will create it.
|
LogLevel
static LogLevel LogLevel
Name
string Name
Get the name of this App instance.
Details | |
---|---|
Returns |
The name of this App instance. If a name wasn't provided via Create(), this returns DefaultName.
|
Options
AppOptions Options
Get the AppOptions the FirebaseApp was created with.
Details | |
---|---|
Returns |
AppOptions used to create the FirebaseApp.
|
Public functions
Dispose
void Dispose()
Public static functions
CheckAndFixDependenciesAsync
System.Threading.Tasks.Task< DependencyStatus > CheckAndFixDependenciesAsync()
Asynchronously checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state and attempts to fix them if they are not.
Note:In some cases, this operation can take a long time and in some cases may prompt the user to update other services on the device. It's recommended to perform other application specific tasks in parallel while checking and potentially fixing dependencies for Firebase. If it's appropriate for your app to handle checking and fixing dependencies separately, you can. Here's effectively what CheckAndFixDependenciesAsync does:
using System.Threading.Tasks; // Needed for the Unwrap extension method. // ... Firebase.FirebaseApp.CheckDependenciesAsync().ContinueWith(checkTask => { // Peek at the status and see if we need to try to fix dependencies. Firebase.DependencyStatus status = checkTask.Result; if (status != Firebase.DependencyStatus.Available) { return Firebase.FirebaseApp.FixDependenciesAsync().ContinueWith(t => { return Firebase.FirebaseApp.CheckDependenciesAsync(); }).Unwrap(); } else { return checkTask; } }).Unwrap().ContinueWith(task => { dependencyStatus = task.Result; if (dependencyStatus == Firebase.DependencyStatus.Available) { // TODO: Continue with Firebase initialization. } else { Debug.LogError( "Could not resolve all Firebase dependencies: " + dependencyStatus); } });
Details | |
---|---|
Returns |
A Task that on completion will contain the DependencyStatus enum value, indicating the state of the required dependencies.
|
CheckDependencies
DependencyStatus CheckDependencies()
Checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state.
Note:This function should only be called before using any Firebase APIs. Deprecated. This method can run very slow on the main thread and will be removed in a future version. Use CheckDependenciesAsync() instead.
Details | |
---|---|
Returns |
DependencyStatus enum value, indicating the state of the required dependencies.
|
CheckDependenciesAsync
System.Threading.Tasks.Task< DependencyStatus > CheckDependenciesAsync()
Asynchronously checks if all of the necessary dependencies for Firebase are present on the system, and in the necessary state.
Note:In some cases, this operation can take a long time. It's recommended to perform other application specific tasks in parallel while checking dependencies for Firebase.
Details | |
---|---|
Returns |
A Task that on completion will contain the DependencyStatus enum value, indicating the state of the required dependencies.
|
Create
FirebaseApp Create()
Initializes the default FirebaseApp with default options.
Details | |
---|---|
Returns |
New FirebaseApp instance.
|
Create
FirebaseApp Create( AppOptions options )
Initializes the default FirebaseApp with the given options.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
New FirebaseApp instance.
|
Create
FirebaseApp Create( AppOptions options, string name )
Initializes a FirebaseApp with the given options that operate on the named app.
Details | ||
---|---|---|
Parameters |
|