Package detail

@nativescript/firebase-core

NativeScript7.3kApache-2.05.0.2

NativeScript Firebase - Core

NativeScript, JavaScript, TypeScript, iOS

readme

@nativescript/firebase-core

A plugin to initialize FirebaseApp in your app.

Use this plugin with any of the following plugins:

Installation

Install the plugin by running the following command in the root directory of your project.

npm install @nativescript/firebase-core

Configure Firebase for Android

To configure Firebase for Android, see Add Firebase to your Android project and follow the steps below.

Configure Firebase for iOS

To set up Firebase for iOS, see Add Firebase to your Apple project and follow the steps below:

Use @nativescript/firebase-core

🚨 Plugin requires both @nativescript/firebase-core and any other @nativescript/firebase-* plugin to successfully initialize.

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

changelog

5.0.0 (2025-05-13)

Features

BREAKING CHANGES

3.3.2 (2024-08-30)

Bug Fixes

  • messaging: null reference when getting current token (#266) (ff516e0)

3.3.1 (2024-05-03)

Features

3.3.0 (2024-05-02)

Bug Fixes

  • core: initializeApp default app not resolved (#255) (486294b)
  • ios: cleaning firebase-messaging-core iOS build warnings (#251) (872c1c2)

Features

  • analytics: iOS SDK 10.24+ (#257) (d8ff8d6)
  • support async callbacks for messages and notification taps (#252) (86a2723)

3.2.0 (2023-09-24)

Features

3.1.3 (2023-07-19)

Bug Fixes

  • analytics: long/double handling for android (#225) (14c26bb)
  • analytics: typings (9251d5c)

3.0.0-alpha.0 (2023-03-23)

Bug Fixes

  • crashlytics/ios: record stacktrace for JS errors (#177) (155cae4)
  • remove buildShortDynamicLink call (#179) (85c3a4f)

Features

2.5.2 (2022-12-27)

Bug Fixes

  • firebase-analytics: consistent handling of Podfile variable $NSFirebaseAnalyticsWithoutAdIdSupport (#167) (7ca3c04)
  • messaging: fcm token callback not fired (4f97aab)

2.5.1 (2022-12-12)

Bug Fixes

  • dynamicLinks: create social builder (a28125f)
  • dynamicLinks: demo (f8ef50c)
  • dynamicLinks: missing setters (a647937)

2.5.0 (2022-12-12)

Bug Fixes

  • dynamic-links: build link before generating long link (#164) (c60775d)
  • dynamic-links: export ShortLinkType as an object (#161) (050e7b9)
  • dynamic-links: instance check (d499eec)
  • dynamic-links: ios parameters builder assigned to wrong variable (#162) (a4a5c45)
  • firestore)(android: arrayUnion always appends null to array (#150) (e1b09f5)
  • firestore: update settings on firestore instance (089b92e)
  • ios/core: filter out nil values from serialize method (#142) (1033984)
  • messaging: Activity registerForActivityResult is not a function (#155) (94f93d2)
  • messaging: delay android messages only until a listener is added (#165) (7b898c4)

Features

  • dynamic-links: support short links on iOS (#163) (3ff4889)

2.4.4 (2022-10-31)

Bug Fixes

  • auth: ios providerData properties undefined (#145) (0836a95)
  • messaging: readme file rename instructions do not work (#146) (162e9d8)

2.4.3 (2022-10-28)

Bug Fixes

  • messaging-core: check permission results size (14b99c8), closes #144

2.4.2 (2022-10-28)

Bug Fixes

  • admob: use content-view (ab32015)
  • auth: languageCode (95122cb)
  • firestore: onSnapshot handling (c74f67a)

2.4.1 (2022-10-19)

Bug Fixes

  • admob: export correct enums (161af8a)
  • database: export (24614e3)
  • firestore: onSnapshot handling (ba384c2)

2.4.0 (2022-10-13)

Bug Fixes

  • admob: import (9c77fa2), closes #140
  • analytics: hook multiple writes (0e00cdc)
  • firestore: fieldPath as key (c4ae70f)
  • firestore: iOS nested FieldValues not serialized in update() (#139) (7f6da0b)

2.4.0-alpha.0 (2022-09-21)

Features

2.3.4 (2022-09-04)

Bug Fixes

  • messaging: promise resolve (0db80d4)

2.3.3 (2022-09-03)

Bug Fixes

  • messaging: handle late permissions request (b95d56c)

2.3.2 (2022-09-03)

Bug Fixes

2.3.1 (2022-09-02)

Bug Fixes

  • messaging: API 33 permission request (39b3b89)

2.3.0 (2022-08-27)

Bug Fixes

  • admob independence , cloud-messaging notification emitting, database unsubscribing & initial dynamicLink (#121) (9908b76), closes #117 #116 #120

2.2.9 (2022-08-08)

Bug Fixes

  • analytics: AnalyticsWithoutAdIdSupport (#115) (9f2d612)
  • analytics: missing postinstall - removing for now (e66578d)
  • database: issue with date handling and accepted ios types (de62bfb)

2.2.7 (2022-08-06)

Bug Fixes

  • database: Set decimal value (bf6c2c5), closes #113
  • database: Unsubscribe to event doesn't work (bda9f9c), closes #109
  • dynamicLinks: initial crash (f052651), closes #111
  • messaging: TNSFirebaseMessaging is not defined (9e129bc), closes #112
  • messaging: Typings for reexported Types that are used in the method definitions (#114) (452fee4)

2.2.6 (2022-08-02)

Bug Fixes

2.2.5 (2022-08-02)

Bug Fixes

2.2.4 (2022-08-02)

Bug Fixes

2.2.3 (2022-07-29)

Bug Fixes

  • database: null handling (1cd39e9)

2.2.2 (2022-07-28)

Bug Fixes

  • messaging: include messaging-core dep (93cfc78)

2.2.1 (2022-07-28)

Bug Fixes

  • core: wrap null as NSNull when wrapping primitives (0e81ad9)

2.2.0 (2022-07-28)

Bug Fixes

  • admob: _BannerAd_listener not defined (2ee0bcf), closes #97
  • admob: request configuration ignored (9d06c1e), closes #103
  • database: handle null serialize (e49d15b), closes #105
  • database: setPersistenceEnabled called multiple times (73c2d72), closes #91
  • dynamic-links: include GoogleUtilities pod (2bbfe51), closes #104
  • messaging: remove POST_NOTIFICATIONS for older api (48397a5)

2.2.0-alpha.1 (2022-07-20)

Bug Fixes

  • messaging-core: AuthorizationStatus enum export (#101) (fa4b6bd)

2.2.0-alpha (2022-07-20)

Bug Fixes

  • messaging: use new requestPermission & permission check for API 33+ (d1328ef)

Features

  • support external push provider (a53d5a9), closes #7

2.1.0 (2022-06-07)

Bug Fixes

  • messaging: TNSFirebaseMessaging is not defined (e66a54d)

Features

  • auth: add getProviderCredential (7af0baf)

2.0.2 (2022-05-29)

Bug Fixes

  • admob: remove deleted method (f0ccb4a)
  • functions: remove deleted method (35c3f44)

2.0.1 (2022-05-19)

Bug Fixes

2.0.0 (2022-05-18)

Bug Fixes

  • admob: declare as static (44f66b9)
  • admob: update input (dcb2b07)
  • auth: currentUser is nullable (#82) (8f5cab1)
  • dynamic-links: prevent crash when annotation is null (#86) (8a53b8b)
  • HttpsCallableResult type (#81) (b6e431b)
  • messaging: prevent loss of messages when app is closed. (#84) (f75d682)
  • TypeError onComplete is not a function (#80) (e575475)
  • appcheck: declare as static (#88) (4dc8122)
  • messaging: declare as static (#77) (4dc8122)

Features

1.2.2 (2022-04-02)

Bug Fixes

  • dynamiclinks: improve onLink handling (9d3fb8c)

1.2.1 (2022-04-01)

Bug Fixes

  • auth: move ios instance setu (57d6c3e)
  • auth: sendEmailVerification crash (335222d)
  • messaging: replace simulator check (70862a8)

Features

1.2.0 (2022-03-21)

Bug Fixes

  • firestore: android write batch (5a3b2a9)
  • firestore: ios date serialization (0182618)

1.1.5 (2022-03-21)

Bug Fixes

  • auth: return currentUser directly from the native instance (#69) (e368012)

1.1.4 (2022-03-16)

Bug Fixes

  • use (anonymous) for empty functionNames when generating stack information (#66) (8e2d1f0), closes #65

Features

  • nx migrate @nativescript/plugin-tools (d081a2d)