react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.

OTHER License

Downloads
5.9M
Stars
11.7K
Committers
513

Bot releases are hidden (Show)

react-native-firebase -

Published by chrisbianca about 7 years ago

Changelog

  • [admob] Fix issue with static event types
react-native-firebase -

Published by chrisbianca about 7 years ago

Changelog

  • [ios] Make iOS installation more resilient
react-native-firebase - v3.0.0

Published by Salakar about 7 years ago

Take me to the docs!

CHANGE LOG.

This release is mainly aimed at adding firebase 'core' functionality, adding phone auth functionality and also a first pass at Cloud Firestore support. There's also been further adjustments to bring the modules in line with the web sdk api. Additionally there's been a lot of internal code improvements aimed at performance and improving QoL for module development.

Whilst every effort has been taken to document all breaking changes there may still be a chance that some undocumented breaking changes have snuck in as this was probably one of the largest releases to date code wise. 🙈 If you come across one then please let us know, we can document it.

Migration guide

See: http://invertase.link/v2-v3

Core

This release introduces full firebase core support. This means multiple firebase apps are now supported both in JS and native android/ios code (initialise additional apps on either end to have the app available in both automatically).

  • #f03c15 [breaking] new RNFirebase() is no longer supported. See below for information about app initialisation.
  • #f03c15 [deprecation] initializeApp() for apps that are already initialised natively (i.e. the default app initialised via google-services plist/json) will now log a deprecation warning.
    • As these apps are already initialised natively there's no need to call initializeApp in your JS code. For now, calling it will just return the app that's already internally initialised - in a future version this will throw an already initialized exception.
    • Accessing apps can now be done the same way as the web sdk, simply call firebase.app() to get the default app, or with the name of specific app as the first arg, e.g. const meow = firebase.app('catsApp'); to get a specific app.
  • FirebaseApp.extendApp(props: Object) support added.
  • RNFirebase no longer requires a singleton exported instance of your app to work (though you can still do this if you'd like). You can now just import RNFirebase in any module and straight away access all the initialised apps. e.g. :
import firebase from 'react-native-firebase';

// get started immediately with the default app for example
firebase.database().ref('kittens').once('value', (snapshot) => {
     console.log('kittenslol', snapshot.val());
});

// or get some other app
const dogsApp = firebase.apps('doge');

// then it's either:

// 1)
dogsApp.database().ref('puppies').once('value', (snapshot) => {
     console.log('muchwow', snapshot.val());
});

// 2) or this one
firebase.database(dogsApp).ref('puppies').once('value', (snapshot) => {
     console.log('muchwow', snapshot.val());
});

See the docs for the following:

  • initialising additional apps via js
    • why js app initialisation is not supported for the default app
    • app.onReady(): Promise and why it's needed for JS initialised apps.
  • which firebase modules support multiple apps
  • delete app caveats - e.g cannot delete default apps, cannot delete apps on android, cannot get app config clientId on ios - see issue comments on firebase repo: https://github.com/firebase/firebase-ios-sdk/issues/140#issuecomment-315953708
  • firebase.SDK_VERSION
  • firebase.DEFAULT_APP_NAME

Auth

  • auth() now supports passing an instance of App as the first argument
  • Phone authentication via verifyPhoneNumber. See #119
  • #f03c15 [breaking] Third party providers now user providerId rather than provider as per the Web SDK. If you are manually creating your credentials, you will need to update the field name.

Firestore

Database

  • database() now supports passing an instance of App as the first argument
  • once now supports context as per the web sdk
  • remove now supports onComplete callbacks (and promises) as per the web sdk
  • update now supports onComplete callbacks (and promises) as per the web sdk
  • setWithPriority now supports onComplete callbacks (and promises) as per the web sdk
  • setPriority now supports onComplete callbacks (and promises) as per the web sdk
  • set now supports onComplete callbacks (and promises) as per the web sdk
  • keepSynced now correctly takes into account query modifiers natively, was ignoring these before
  • improved native transaction implementations to have better error handling and timeout checks (mainly for whilst running in dev)
    • [websdk-diff] the web sdk transaction errors return one worded errors that don't make much sense and have no error codes or description like all the other database errors do. RNFirebase internally maps these into the database error codes we're accustomed to, for example the one worder above comes back as The transaction was overridden by a subsequent set. (database/overridden-by-set) instead.
  • [ios] implemented missing onDisconnectUpdate method. See #272.
  • #f03c15 [breaking] error messages and codes internally re-written to match the web sdk
  • #f03c15 [breaking] ref.isEqual now checks the query modifiers as well as the ref path (was just path before). With the release of multi apps/core support this check now also includes whether the refs are for the same app.
  • #f03c15 [breaking] on/off behaviour changes. Previous off behaviour was incorrect. A SyncTree/Repo implementation was added to provide the correct behaviour you'd expect in the web sdk. Whilst this is a breaking change it shouldn't be much of an issue if you've previously setup your on/off handling correctly. See #160 for specifics of this change.
  • [internal] re-wrote native android & ios methods to now use RN promise implementation - was callbacks before with a callback to promise wrapper in JS
  • [js] ThenableReference support implemented, for now this is just for .push(). See #147.

Storage

  • storage() now supports passing an instance of App as the first argument
  • [ios] putFile now sets the remote file content/type automatically for images and videos (Android TODO)
  • #f03c15 [breaking] UploadTaskSnapshot -> downloadUrl renamed to downloadURL to match web sdk

Misc

  • We're now using Apache License 2.0 to license this library.
  • [internal] re-wrote event emitter / subscriptions logic to be more performant and to support multiple database/app instances. This is for events such as storage task events, database transaction/realtime events and authentication state changes.
  • QoL change: added more descriptive errors on incorrect setup of native modules, e.g:
    image
  • QoL change: added Groovy script to RNFirebase build.gradle to automatically detect duplicate dex build failures:
    image

Known Issues

As these aren't major issues we've decided that they shouldn't hold back the release of v3,

  • Currently no way to enable RNFirebase debug logging.
react-native-firebase -

Published by chrisbianca about 7 years ago

Changelog

  • [android] Support breaking changes in react native 0.47.0

Note: This version is still backwards compatible with earlier versions of React Native: 0.40.0+

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)

react-native-firebase -

Published by chrisbianca about 7 years ago

Changelog

Database

  • [ios] Fix log warnings #233
  • [android][ios] Add missing setPriority and setWithPriority methods

Config

  • [ios] Fix missing import #234
  • [ios] Fix incorrect status message when remote config fetch is successful #280 (Thanks @akshetpandey)

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)

react-native-firebase -

Published by chrisbianca over 7 years ago

Changelog

Messaging

  • [ios] Re-added didReceiveNotificationResponse and willPresentNotification

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)

react-native-firebase - v2.0.3

Published by Salakar over 7 years ago

Changelog

Auth

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)

react-native-firebase - v2.0.2

Published by Salakar over 7 years ago

Changelog

Auth

  • [both] implemented missing confirmPasswordResetmethod
  • [both] implemented missing applyActionCodemethod
  • [both] implemented missing checkActionCodemethod

Misc changes to tests documentation also: http://invertase.io/react-native-firebase/#/contributing/testing

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)

react-native-firebase - v2.0.1

Published by Ehesp over 7 years ago

View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)

View build details and download artifacts on buddybuild:

react-native-firebase - v1.1.2

Published by Salakar over 7 years ago

Changelog

  • [ios] sendEmailVerification now correctly returns currentUser - thanks @jasan-s for helping us debug it.
react-native-firebase -

Published by chrisbianca over 7 years ago

Changelog

[android][database] Fix hanging db when querying database object with large numeric keys
[ios] Remove react-native link installation scripts to minimise installation issues

react-native-firebase - v2.0.0

Published by Ehesp over 7 years ago

Migration guide

A guide to upgrading from v1 to v2 can be found on the docs here.

Change Log

Version 2.0.0 of RNFirebase introduces new features, breaking changes, deprecations (matching v4 of the web SDK) and general build / dependency improvements.

New Features

Ads

  • Implemented Admob Banner view
  • Implemented Admob Interstitials
  • Implemented Admob Rewarded Video
  • Implemented Admob Native Express

Performance Monitoring

RNFirebase now supports the recently released Performance Monitoring module. Much like Crash Reporting, automatic events (traces) are delivered to your console whilst providing support to register custom traces. See the documentation on how to use this in your app.

Implemented methods:

  • setPerformanceCollectionEnabled(enabled: boolean)
  • newTrace(id: string): Trace
  • Trace.start(): void
  • Trace.incrementCounter(event: string): void
  • Trace.stop(): void

Remote Config

  • [both] Implemented remote config in v1.1.0 - adding here for sake of completeness. Documentation

Auth

Crash

  • [android] Implemented new crash log disabling methods.

Bug Fixes

  • [js] Fixed an issue whereby the result of onAuthStateChange returned a different result on state changes.

Breaking Changes & Deprecations

  • [breaking] RNFirebase v2.0.0 drops support for React Native versions less than v40
  • [deprecated] providerId should now be used instead of provider whilst obtaining auth credentials. The latter will be removed in future releases.
  • [deprecated] Deprecated User.getToken in favour of User.getIdToken.
  • [breaking] User.reauthenticate has been removed in favour of User.reauthenticateWithCredential.
  • [breaking] User.link has been removed in favour of User.linkWithCredential.
  • [breaking] Removed unnecessary didReceiveNotificationResponse and willPresentNotification methods for iOS messaging. Added additional didReceiveRemoteNotification method.
  • [breaking] firebase.messaging().onTokenRefresh and firebase.messaging().onMessage return a function to unsubscribe as per the Web SDK spec: https://firebase.google.com/docs/reference/js/firebase.messaging.Messaging#onMessage. Previously they returned an object with a .remove() method.

Android

All firebase modules are now optional so you only need to import the Firebase functionality that you require in your application.

You need to make a couple of changes to your app/build.gradle file. Update the react-native-firebase compile statement to read:

compile(project(':react-native-firebase')) {
  transitive = false
}
compile "com.google.firebase:firebase-core:11.0.0"

Add each of the firebase modules you need from the following list:

compile "com.google.firebase:firebase-ads:11.0.0"
compile "com.google.firebase:firebase-analytics:11.0.0"
compile "com.google.firebase:firebase-auth:11.0.0"
compile "com.google.firebase:firebase-config:11.0.0"
compile "com.google.firebase:firebase-crash:11.0.0"
compile "com.google.firebase:firebase-database:11.0.0"
compile "com.google.firebase:firebase-messaging:11.0.0"
compile "com.google.firebase:firebase-perf:11.0.0"
compile "com.google.firebase:firebase-storage:11.0.0"

Update MainApplication.java and import the modules as required:

import io.invertase.firebase.admob.RNFirebaseAdMobPackage; //Firebase AdMob
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage; // Firebase Analytics
import io.invertase.firebase.auth.RNFirebaseAuthPackage; // Firebase Auth
import io.invertase.firebase.config.RNFirebaseRemoteConfigPackage; // Firebase Remote Config
import io.invertase.firebase.crash.RNFirebaseCrashPackage; // Firebase Crash Reporting
import io.invertase.firebase.database.RNFirebaseDatabasePackage; // Firebase Realtime Database
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage; // Firebase Cloud Messaging
import io.invertase.firebase.perf.RNFirebasePerformancePackage; // Firebase Performance Monitoring
import io.invertase.firebase.storage.RNFirebaseStoragePackage; // Firebase Storage

Add the packages to the getPackages() method as required:

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new RNFirebasePackage(),  // <-- Add this line
          // Add these packages as appropriate
          new RNFirebaseAdMobPackage(),
          new RNFirebaseAnalyticsPackage(),
          new RNFirebaseAuthPackage(),
          new RNFirebaseRemoteConfigPackage(),
          new RNFirebaseCrashPackage(),
          new RNFirebaseDatabasePackage(),
          new RNFirebaseMessagingPackage(),
          new RNFirebasePerformancePackage(),
          new RNFirebaseStoragePackage()
      );
    }

iOS

All firebase modules are now optional so you only need to import the Firebase functionality that you require in your application. Simply update your Podfile to only include the Firebase modules for functionality that you require in your app.

react-native-firebase - v1.1.0

Published by Ehesp over 7 years ago

Changelog

These release notes cover the major changes for versions v1.0.2...v1.1.0

General

  • Updated typescript definitions (@taljacobson)
  • [android] Updated Firebase version to 10.2.6. iOS will be upgraded once tests are passing.

Database

Remote Config

Remote config has been implemented on both Android & iOS (@akshetpandey)

react-native-firebase - v1.0.2

Published by Salakar over 7 years ago

Changelog

This change log includes changes for alpha14 + v1.0.1 releases.

General

Database

Test app

react-native-firebase - v1.0.0-alpha13

Published by chrisbianca over 7 years ago

Changelog

Crash reporting

[ios] Fixed CrashReporting imports

Database

[js][android][ios] Support multiple listeners on a ref
[ios] Fixed onDisconnectSet
[js] Add ref property for consistency with web API
[js] Add ref().isEqual()

Storage

[js] uploadTask.on now correctly handles next or observer args as per firebase web sdk
[js][android][ios] uploadTask.on now correctly receives a success status event
[android] fix readable map already consumed error

Misc

[js][android] Use GoogleApiAvailability to prompt the user to install Google Play Services if it is not installed

Known Issues

[storage] upload/download task promises implementation currently WIP and may break if used, use the event callbacks instead.

react-native-firebase - 1.0.0-alpha12

Published by Salakar over 7 years ago

Changelog

  • [js][ios][messaging] fixed misc messaging .send() type errors
react-native-firebase - 1.0.0-alpha11

Published by Salakar over 7 years ago

Changelog

All platforms

react-native-firebase - 1.0.0-alpha10

Published by Salakar over 7 years ago

Changes

Android

  • [storage] implemented storage methods to match ios, fixes the android storage breaking change in alpha9. @Salakar
  • [messaging] added missing boot event receiver for scheduled notifications. @chrisbianca

IOS

  • [messaging] fixed issue with notification .finish() incorrectly expecting an object instead of a string. @chrisbianca
  • [messaging] add a promise response to iOS messaging requestPermissions to return permission popup response (iOS 10+) @chrisbianca

And misc docs from @Ehesp and @chrisbianca

react-native-firebase - 1.0.0-alpha9

Published by Salakar over 7 years ago

Changes

Big feature landed, brace yourself...

Transactions

  • Implemented transaction support for both android and ios platforms.
react-native-firebase - 1.0.0-alpha8

Published by Salakar over 7 years ago

Changes

  • [ios][storage] storage re-implemented to use native promises
  • [ios][storage] errors now mirror web sdk errors e.g. storage/unauthorized
  • [ios][storage] fixed an issue where certain storage NSErrors were unable to be sent across RNBridge
  • [js][database] firebase.database().ServerValue moved to firebase.database.ServerValue
  • [js][storage] fixed an issue with StorageTask.then/.catch being incorrectly bound
  • [js][storage] implemented firebase.storage.TaskState enums
  • [js][storage] implemented firebase.storage.TaskEvent enums
  • [js][storage] moved firebase.storage().constants to firebase.storage.Native to match other enums
  • misc docs

Note: Android storage is currently broken due to the js updates, will fix this in alpha9 in the next day or so.

Package Rankings
Top 0.59% on Npmjs.org
Top 8.61% on Pub.dev
Top 9.8% on Proxy.golang.org
Badges
Extracted from project README
badge badge badge badge badge badge badge badge badge badge badge badge badge badge badge badge badge
Related Projects