Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nativescript/firebase-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@nativescript/firebase-core
A plugin to initialize FirebaseApp in your app. It should be used with any of:
- @nativescript/firebase-admob
- @nativescript/firebase-analytics
- @nativescript/firebase-app-check
- @nativescript/firebase-app-check-debug
- @nativescript/firebase-auth
- @nativescript/firebase-crashlytics
- @nativescript/firebase-database
- @nativescript/firebase-dynamic-links
- @nativescript/firebase-firestore
- @nativescript/firebase-functions
- @nativescript/firebase-in-app-messaging
- @nativescript/firebase-installations
- @nativescript/firebase-messaging
- @nativescript/firebase-messaging-core
- @nativescript/firebase-performance
- @nativescript/firebase-remote-config
- @nativescript/firebase-storage
Installation
npm install @nativescript/firebase-coreConfigure Firebase for Android
To configure Firebase for Android, visit Add Firebase to your Android project and follow the steps below.
Add a Firebase configuration file : Download the
google-services.jsonfile and add it toApp_Resources/Android/src.
Configure Firebase for iOS
To set up Firebase for iOS, visit Add Firebase to your Apple project and follow the steps below:
- Create a Firebase project
- Register your app with Firebase
- Add a Firebase configuration file: Download the
GoogleService-Info.plistfile and add it toApp_Resources/iOS/.
Use @nativescript/firebase-core
Instantiate Firebase and initialize a default app
Import the firebase function and call it to create a NativeScript Firebase instance. Next, call the initializeApp method on the Firebase instance to instantiate the native FirebaseApp.
import { firebase } from '@nativescript/firebase-core'
const defaultApp = await firebase().initializeApp();Initialize Secondary App
import { firebase, FirebaseOptions } from '@nativescript/firebase-core'
const config = new FirebaseOptions()
const secondaryApp = await firebase().initializeApp(config, 'SECONDARY_APP');License
Apache License Version 2.0