expo-firebase-core
provides access to the Firebase configuration and performs initialisation
of the native Firebase App.Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
→
expo install expo-firebase-core
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
No explicit calls toexpo-firebase-core
are required to initialize Firebase. This library will auto-initialize the Firebase app when a valid configuration exists.
import * as FirebaseCore from 'expo-firebase-core';
Type: string | void
Name of the default Firebase app (e.g. [DEFAULT]
).
In Expo Go, a Firebase App is created for each project that is loaded, and a unique name for each project is returned.
Type: FirebaseOptions | void
Firebase options with which the default app was initialized. If no Google services configuration
was provided, undefined
is returned.
Depending on the platform, the options are read from the following files and app.json
keys.
Platform | File | App.json key |
---|---|---|
iOS | GoogleService-Info.plist | ios.googleServicesFile |
Android | google-services.json | android.googleServicesFile |
Web | - | web.config.firebase |
console.log(FirebaseCore.DEFAULT_APP_OPTIONS); { appId: "1:1082251606918:ios:a2800bc715889446e24a07", apiKey: "AIzaXXXXXXXX-xxxxxxxxxxxxxxxxxxx", clientId: "000000000000-0000000000000.apps.googleusercontent.com", trackingId: 12345567890, databaseURL: "https://myexpoapp777.firebaseio.com", storageBucket: "myexpoapp777.appspot.com", projectId: "myexpoapp777", messagingSenderId: 123454321 }
Type: FirebaseOptions | void
The default Firebase options as defined in web.config.firebase
in app.json
.
Name | Type | Description |
---|---|---|
apiKey (optional) | string | Firebase API key. |
appId (optional) | string | Unique identifier of the Firebase app. |
authDomain (optional) | string | - |
databaseURL (optional) | string | Firebase database URL. |
measurementId (optional) | string | - |
messagingSenderId (optional) | string | - |
projectId (optional) | string | Unique identifier of the Firebase project. |
storageBucket (optional) | string | Google Cloud Storage bucket name. |
trackingId (optional) | string | Tracking identifier for Google Analytics. |