Stay organized with collections
Save and categorize content based on your preferences.
FirebaseApp
classFirebaseApp:NSObject
The entry point of Firebase SDKs.
Initialize and configure FirebaseApp using FirebaseApp.configure()
or other customized ways as shown below.
The logging system has two modes: default mode and debug mode. In default mode, only logs with
log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent
to device. The log levels that Firebase uses are consistent with the ASL log levels.
Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this
argument in the application’s Xcode scheme. When debug mode is enabled via -FIRDebugEnabled,
further executions of the application will also be in debug mode. In order to return to default
mode, you must explicitly disable the debug mode with the application argument
-FIRDebugDisabled.
It is also possible to change the default logging level in code by calling
FirebaseConfiguration.shared.setLoggerLevel(_:) with the desired level.
Configures a default Firebase app. Raises an exception if any configuration step fails. The
default app is named “__FIRAPP_DEFAULT”. This method should be called after the app is launched
and before using Firebase services. This method should be called from the main thread and
contains synchronous file I/O (reading GoogleService-Info.plist from disk).
Configures the default Firebase app with the provided options. The default app is named
“__FIRAPP_DEFAULT”. Raises an exception if any configuration step fails. This method should be
called from the main thread.
Declaration
Swift
classfuncconfigure(options:FIROptions)
Parameters
options
The Firebase application options used to configure the service.
Configures a Firebase app with the given name and options. Raises an exception if any
configuration step fails. This method should be called from the main thread.
Gets or sets whether automatic data collection is enabled for all products. Defaults to true
unless FirebaseDataCollectionDefaultEnabled is set to NO in your app’s Info.plist. This value
is persisted across runs of the app so that it can be set once when users have consented to
collection.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-11 UTC."],[],[],null,["# FirebaseCore Framework Reference\n\nFirebaseApp\n===========\n\n class FirebaseApp : NSObject\n\nThe entry point of Firebase SDKs.\n\nInitialize and configure `FirebaseApp` using [FirebaseApp.configure()](../Classes/FirebaseApp.html#/c:objc(cs)FIRApp(cm)configure)\nor other customized ways as shown below.\n\nThe logging system has two modes: default mode and debug mode. In default mode, only logs with\nlog level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent\nto device. The log levels that Firebase uses are consistent with the ASL log levels.\n\nEnable debug mode by passing the `-FIRDebugEnabled` argument to the application. You can add this\nargument in the application's Xcode scheme. When debug mode is enabled via `-FIRDebugEnabled`,\nfurther executions of the application will also be in debug mode. In order to return to default\nmode, you must explicitly disable the debug mode with the application argument\n`-FIRDebugDisabled`.\n\nIt is also possible to change the default logging level in code by calling\n`FirebaseConfiguration.shared.setLoggerLevel(_:)` with the desired level.\n- `\n ``\n ``\n `\n\n ### [configure()](#/c:objc(cs)FIRApp(cm)configure)\n\n `\n ` \n Configures a default Firebase app. Raises an exception if any configuration step fails. The\n default app is named \"__FIRAPP_DEFAULT\". This method should be called after the app is launched\n and before using Firebase services. This method should be called from the main thread and\n contains synchronous file I/O (reading GoogleService-Info.plist from disk). \n\n #### Declaration\n\n Swift \n\n class func configure()\n\n- `\n ``\n ``\n `\n\n ### [configure(options:)](#/c:objc(cs)FIRApp(cm)configureWithOptions:)\n\n `\n ` \n Configures the default Firebase app with the provided options. The default app is named\n \"__FIRAPP_DEFAULT\". Raises an exception if any configuration step fails. This method should be\n called from the main thread. \n\n #### Declaration\n\n Swift \n\n class func configure(options: FIROptions)\n\n #### Parameters\n\n |-----------------|-----------------------------------------------------------------|\n | ` `*options*` ` | The Firebase application options used to configure the service. |\n\n- `\n ``\n ``\n `\n\n ### [configure(name:options:)](#/c:objc(cs)FIRApp(cm)configureWithName:options:)\n\n `\n ` \n Configures a Firebase app with the given name and options. Raises an exception if any\n configuration step fails. This method should be called from the main thread. \n\n #### Declaration\n\n Swift \n\n class func configure(name: String, options: FIROptions)\n\n #### Parameters\n\n |-----------------|---------------------------------------------------------------------------------------------------------------------|\n | ` `*name*` ` | The application's name given by the developer. The name should should only contain Letters, Numbers and Underscore. |\n | ` `*options*` ` | The Firebase application options used to configure the services. |\n\n- `\n ``\n ``\n `\n\n ### [app()](#/c:objc(cs)FIRApp(cm)defaultApp)\n\n `\n ` \n Returns the default app, or `nil` if the default app does not exist. \n\n #### Declaration\n\n Swift \n\n class func app() -\u003e FirebaseApp?\n\n- `\n ``\n ``\n `\n\n ### [app(name:)](#/c:objc(cs)FIRApp(cm)appNamed:)\n\n `\n ` \n Returns a previously created `FirebaseApp` instance with the given name, or `nil` if no such app\n exists. This method is thread safe. \n\n #### Declaration\n\n Swift \n\n class func app(name: String) -\u003e FirebaseApp?\n\n- `\n ``\n ``\n `\n\n ### [allApps](#/c:objc(cs)FIRApp(cpy)allApps)\n\n `\n ` \n Returns the set of all extant `FirebaseApp` instances, or `nil` if there are no `FirebaseApp`\n instances. This method is thread safe. \n\n #### Declaration\n\n Swift \n\n class var allApps: [String : FirebaseApp]? { get }\n\n- `\n ``\n ``\n `\n\n ### [delete()](#/c:objc(cs)FIRApp(im)deleteApp:)\n\n `\n ` \n Cleans up the current `FirebaseApp`, freeing associated data and returning its name to the pool\n for future use. This method is thread safe. \n\n #### Declaration\n\n Swift \n\n func delete() async -\u003e Bool\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)FIRApp(im)init)\n\n `\n ` \n Unavailable \n `FirebaseApp` instances should not be initialized directly. Call [FirebaseApp.configure()](../Classes/FirebaseApp.html#/c:objc(cs)FIRApp(cm)configure),\n [FirebaseApp.configure(options:)](../Classes/FirebaseApp.html#/c:objc(cs)FIRApp(cm)configureWithOptions:), or [FirebaseApp.configure(name:options:)](../Classes/FirebaseApp.html#/c:objc(cs)FIRApp(cm)configureWithName:options:) directly.\n- `\n ``\n ``\n `\n\n ### [name](#/c:objc(cs)FIRApp(py)name)\n\n `\n ` \n Gets the name of this app. \n\n #### Declaration\n\n Swift \n\n var name: String { get }\n\n- `\n ``\n ``\n `\n\n ### [options](#/c:objc(cs)FIRApp(py)options)\n\n `\n ` \n Gets a copy of the options for this app. These are non-modifiable. \n\n #### Declaration\n\n Swift \n\n @NSCopying var options: FIROptions { get }\n\n- `\n ``\n ``\n `\n\n ### [isDataCollectionDefaultEnabled](#/c:objc(cs)FIRApp(py)dataCollectionDefaultEnabled)\n\n `\n ` \n Gets or sets whether automatic data collection is enabled for all products. Defaults to `true`\n unless `FirebaseDataCollectionDefaultEnabled` is set to `NO` in your app's Info.plist. This value\n is persisted across runs of the app so that it can be set once when users have consented to\n collection. \n\n #### Declaration\n\n Swift \n\n var isDataCollectionDefaultEnabled: Bool { get set }"]]