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 Ehesp almost 6 years ago

v5.1.0-rc2

Bug fixes

Database

Notifications

  • [ios] Add missing default case to scheduled notifications with intervals
  • [js] Change IOSNotification badge type definition to number

Storage

  • [android] Returning null within getDownloadUrl now successfully resolves.

New Features

Database / Utils

  • [js] Added a firebase.utils().database.cleanup() utility method which removes all database listeners.

Messaging

react-native-firebase -

Published by Salakar about 6 years ago

Please report any bugs with this RC in the #pre-releases channel on Discord or through a GitHub issue with a [v5.1.0-rc1] tag in the title.

Installation

yarn add [email protected]

or

npm install [email protected]

Changes

  • [notifications][ios] fixed a crash on completing a notification #1576
  • [notifications][android] fixed multiple NoSuchMethodError exceptions on < API 26 (#1550 #1549 #1553 #1399)
  • [notifications][android] DisplayNotificationTask now correctly uses WeakReference to keep ref to Context (avoids mem leaks)
  • [notifications][android] removeDeliveredNotificationsByTag now correctly removes #1546
  • [notifications][android] fix removeDeliveredNotificationsByTag crash #1392
  • [firestore][ios] improve/rework native transaction code to prevent potential race conditions #1556
  • [database][js] add reference toJSON() to match web sdk
  • [android][build] force Java 8 target compatibility for JDK 10 - #1070
  • [android][build] remove fabric build tools from lib - only needed in users build.gradle
  • [android] replace android.support NonNull & Nullable annotation instances with java annotations
    • removes dependency on android support v4 annotations
  • [links][typescript] fix types for createShortDynamicLink - #1580
  • [functions][typescript] add export of functions type #1533
  • [metro][js] add workaround for module-resolver bug - #1560

SDK Version Updates

  • [ios] updated Firebase SDKs to v5.10.0
  • [android] updated gradle build tools to 3.2.0
    • classpath 'com.android.tools.build:gradle:3.2.0'
  • [android] updated default build tools version to 28.0.2
  • [android] updated play-services-base to 16.0.1
  • [android] updated Firebase SDKs;
  implementation "com.google.firebase:firebase-core:16.0.4"


  /* -------------------------
   *   OPTIONAL FIREBASE SDKS
   * ------------------------- */

  implementation('com.google.firebase:firebase-ads:15.0.1') {
    // exclude `customtabs` as the support lib version is out of date
    // we manually add it as a dependency below with a custom version
    exclude group: 'com.android.support', module: 'customtabs'
  }

  // Authentication
  implementation "com.google.firebase:firebase-auth:16.0.4"
  // Analytics
  implementation "com.google.firebase:firebase-analytics:16.0.4"
  // Performance Monitoring
  implementation "com.google.firebase:firebase-perf:16.1.2"
  // Remote Config
  implementation "com.google.firebase:firebase-config:16.0.1"
  // Cloud Storage
  implementation "com.google.firebase:firebase-storage:16.0.3"
  // Invites
  implementation "com.google.firebase:firebase-invites:16.0.4"
  // Dynamic Links
  implementation "com.google.firebase:firebase-dynamic-links:16.1.2"
  // Real-time Database
  implementation "com.google.firebase:firebase-database:16.0.3"
  // Cloud Functions
  implementation "com.google.firebase:firebase-functions:16.1.1"
  // Cloud Firestore
  implementation "com.google.firebase:firebase-firestore:17.1.1"
  // Cloud Messaging / FCM
  implementation "com.google.firebase:firebase-messaging:17.3.3"
  // Crashlytics
  implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
    transitive = true
  }

  /* --------------------------------
   *  OPTIONAL SUPPORT LIBS
   * -------------------------------- */

  // For Firebase Ads
  implementation "com.android.support:customtabs:27.1.1"

  // For React Native Firebase Notifications
  implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
   classpath 'com.android.tools.build:gradle:3.2.0'
   classpath 'com.google.gms:google-services:4.0.1'
   classpath 'com.google.firebase:firebase-plugins:1.1.5'
   classpath 'io.fabric.tools:gradle:1.25.4'
  • [android] updated to gradle 4.6

You can update your gradle if required by adding the following at the bottom of your /android/build.gradle

task wrapper(type: Wrapper) {
  gradleVersion = '4.6'
  distributionUrl = distributionUrl.replace("bin", "all")
}

Or by modifying the distributionUrl in /android/gradle/wrapper/gradle-wrapper.properties

react-native-firebase - v5.0.0

Published by Salakar about 6 years ago

See the website for release notes: https://rnfirebase.io/docs/v5.x.x/release-notes

react-native-firebase - v4.3.8

Published by Salakar about 6 years ago

Big thanks to all the contributors who helped submit the below changes / report the bugs πŸŽ‰

  • @vonovak
  • @erandagan
  • @dgruseck
  • @damienix
  • @dluksza
  • @aMarCruz

Messaging

  • [ios][messaging] fix #1286 - 'getToken resolves to null if called too early'

Notifications

  • [android] prefer localised title and body to normal title and body #1337
  • [android] add the ability to remove notifications based on the tag #1058 (pending documentation)
  • [android] fix rescheduling notification on phone reboot #1312
    • Scheduled notifications not being rescheduled on phone reboot #1308
  • [android] honour repeatInterval when rescheduling outdated notification #1294
    • Scheduled notifications not being rescheduled on phone reboot #1308

Remote Config


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

react-native-firebase - v4.3.0

Published by Salakar over 6 years ago

v4.3.0 Changelog

As always - huge thanks to all our contributors and everyone that has helped debug issues.

Upgrade Guide

This release does NOT support React Native v0.56.x - this will come in the v5.0.0 release due to backwards incompatible breaking changes.

See minor storage change below and update your code if it affects you.

Our testing project can also be inspected as a reference / guide to versions etc. It's located here.

Android - Upgrade Guide

Update your in-use Firebase SDK dependencies to match the following versions:

// android/app/build.gradle

// RNFirebase required dependencies
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.android.gms:play-services-base:15.0.1"

// RNFirebase optional dependencies
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation "com.google.firebase:firebase-crash:16.0.1"
implementation "com.google.firebase:firebase-database:16.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.2"
implementation "com.google.firebase:firebase-functions:16.0.1"
implementation "com.google.firebase:firebase-invites:16.0.1"
implementation "com.google.firebase:firebase-storage:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation "com.google.firebase:firebase-perf:16.0.0"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
  transitive = true
}

If you use Crashlytics, update your fabric gradle tools version:

// android/build.gradle

// ...
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.google.gms:google-services:4.0.1'
    classpath 'com.google.firebase:firebase-plugins:1.1.1'
// ... THIS --------------------------- \/
    classpath 'io.fabric.tools:gradle:1.25.4'
// ... THIS --------------------------- /\
// ...

iOS - Upgrade Guide

We recommend locking your Firebase SDK pods to the versions in the Podfile example below:

Going forward we'll only be supporting specific versions per release, this is to prevent issues with compilation on xcode e.g. missing symbols.

# ...
pod 'Firebase/AdMob', '~> 5.3.0'
pod 'Firebase/Auth', '~> 5.3.0'
pod 'Firebase/Core', '~> 5.3.0'
pod 'Firebase/Crash', '~> 5.3.0'
pod 'Firebase/Database', '~> 5.3.0'
pod 'Firebase/Functions', '~> 5.3.0'
pod 'Firebase/DynamicLinks', '~> 5.3.0'
pod 'Firebase/Firestore', '~> 5.3.0'
pod 'Firebase/Invites', '~> 5.3.0'
pod 'Firebase/Messaging', '~> 5.3.0'
pod 'Firebase/RemoteConfig', '~> 5.3.0'
pod 'Firebase/Storage', '~> 5.3.0'
pod 'Firebase/Performance', '~> 5.3.0'

pod 'Fabric', '~> 1.7.5'
pod 'Crashlytics', '~> 3.10.4'
# ...

Admob

Analytics

  • [ios] fixed deadlock #1195

Auth

  • [android] add support for phone auth ForceResendingToken, closes #721
  • [android] fix crash on signInAndRetrieveDataWithCredential() when using twitter auth #1249

Cloud Firestore

  • [android][ios] add support for GetOptions #1248

Database

  • [android] allow apps to use initializeApp() to configure firebase database #1193

IID

Notifications

  • [android] fix setDefaults on Notifications. #1235
  • [android] add support for areNotificationsEnabled #1164
  • [android] fix for Notification setProgress not working #1167
  • [android][js] resolve display notification promise #1113
  • [android] add support for drawable resources to AndroidNotification #1221
  • [android][js] closes #1216 : AndroidNotification.setVisibility does not exists #1219
  • [js][android] closes #1213 : Incorrect definition of Android.Importance.None #1220

Storage

  • [ios] fixed deadlock #1195
  • [ios] app crashes when storage().putFile is called with assets-library uri on iOS #1232
  • [ios][android] firebase Storage image upload ignores contentType metadata #739
  • [js] putFile error #1177 - added automatic decodeURI'ing on file path
  • MINOR [js][android] inconsistent paths with/out trailing slashes in firebase.storage.Native #1200
    - small breaking change: any paths here that had a trailing slash before will now no longer have one. Adjust your file paths that used these statics to compensate

Typings

  • [flow][db] Modifies db Reference push() to return ThenableReference https://github.com/invertase/react-native-firebase/pull/869
  • [ts][config] add type definition for RemoteConfig module #1226
  • [ts][iid] add getToken(string,string) and deleteToken(string,string) to typings
  • [ts][auth] updated typings for PhoneAuthListener #1185

Misc

  • Update fabric tools version to v1.25.4 #1269

Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

react-native-firebase - v4.2.0

Published by chrisbianca over 6 years ago

v4.2.0 Changelog

If you are upgrading from a version prior to v4.1.0, please make sure you have checked for breaking changes in the release notes for all missed versions.

iOS Breaking Changes

  • This version supports v5+ of the Firebase iOS pods which contained a number of breaking changes"

    1. If you had previously restricted the version of Firebase/Core to 4.13.0, you will need to remove that restriction.
    2. Run pod update to get the latest versions of all the Firebase pods.

Auth

  • Full support for the new passwordless email sign in functionality: fetchSignInMethodsForEmail, isSignInWithEmailLink, sendSignInLinkToEmail and signInWithEmailLink

Database

  • [ios] Use a separate dispatch queue for requests

Firestore

  • [ios] Use a separate dispatch queue for requests and callbacks to improve performance - thanks @bzztbomb

Invites

  • [android] #1072 Fix a bug with invitation email keys - thanks @arnabkund

Messaging

  • [ios] Cache and send data messages received whilst the app is being initialised - fixes #1005

Notifications

  • [android] #1073 Fix ClassCastException while parsing fireDate - thanks @dluksza
  • [android] #1080 Add support for deleting channels and channel groups - thanks @dluksza
  • [android] #1088 Correctly resolve promise when cancelling a notification - thanks @pranjal-jain
  • [android] #1074 Support handling of notification actions without waking the UI - thanks @dluksza
react-native-firebase - v4.1.0

Published by chrisbianca over 6 years ago

v4.1.0 Changelog

NEW - Functions

  • We now have support for Firebase Cloud Functions within react-native-firebase. Check out the docs for more info.

Android Breaking Changes

  • Google recently changed the way their Android libraries are released so each import is now versioned independently.
  • This requires a few changes to your build configuration files:

Update android/build.gradle

Check that you're using the following versions of these plugins:

classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'

Update android/app/build.gradle

You need to be using at least the following versions of the firebase and gms imports:

  • com.google.android.gms:play-services-base: 15.0.0
  • com.google.firebase:firebase-core: 15.0.2
  • com.google.firebase:firebase-ads: 15.0.0
  • com.google.firebase:firebase-auth: 15.1.0
  • com.google.firebase:firebase-config: 15.0.0
  • com.google.firebase:firebase-crash: 15.0.2
  • com.google.firebase:firebase-database: 15.0.0
  • com.google.firebase:firebase-firestore: 16.0.0
  • com.google.firebase:firebase-functions: 15.0.0
  • com.google.firebase:firebase-invites: 15.0.1
  • com.google.firebase:firebase-messaging: 15.0.2
  • com.google.firebase:firebase-perf: 15.1.0
  • com.google.firebase:firebase-storage: 15.0.2
  • com.crashlytics.sdk.android:crashlytics: 2.9.1

Firestore Breaking Changes

  • The DocumentListenOptions and QueryListenOptions objects passed into DocumentReference.onSnapshot and CollectionReference.onSnapshot have been updated to use a single MetadataChanges object
  • If you were using the includeDocumentMetadataChanges and includeQueryMetadataChanges flags, then they need to be merged into a single includeMetadataChanges flag instead
react-native-firebase - v4.0.7

Published by chrisbianca over 6 years ago

v4.0.7 Changelog

Firestore

  • Add Blob support

Notifications

  • [android] #1035 Fix Android rescheduled notifications firing immediately - thanks @liamheneghan
  • [android] Fix for #996 - Schedule notifications not firing in the background when using big picture

General

  • [ios] #1017 Add Firebase/Core to podspec
react-native-firebase - v4.0.6

Published by chrisbianca over 6 years ago

v4.0.6 Changelog

Auth

  • Fix for #980 - possible race condition when initialising onAuthStateChanged

Firestore

  • [typings] #1018 Fix for Firestore Query .where TypeScript typings - thanks @awmichel

Notifications

  • [android] #1010 Allow passing null as a sound - thanks @giladno
  • [android] Fix for #1013 - NullPointerException when rescheduling notifications
react-native-firebase - v4.0.5

Published by Salakar over 6 years ago

v4.0.5 Changelog

Firestore

Database

Android

  • [build] #1007 allow root project to specify dependency versions - thanks @mlc
  • [build] fix for #1004 - moved database snapshot utils into it's own class inside database package rather than in the shared utils class.

Typings

  • #1002 prefer string over String - thanks @sibelius
react-native-firebase - v4.0.4

Published by Salakar over 6 years ago

v4.0.4 Changelog

Firestore

Notifications

Types / Flow

react-native-firebase -

Published by chrisbianca over 6 years ago

v4.0.3 Changelog

Firestore

  • Add support for firebase.firestore().settings() - psst, this allows you to disable persistence ;-)
  • Add support for firebase.firestore().setLogLevel()
  • Fix a binding issue with DocumentSnapshot data() and get()

Messaging

  • [ios] Fix messaging_token_refreshed warning #960

Notifications

  • [ios] Fix sound on iOS 10+ #974
  • [ios] Add missing completionhandler calls
  • [ios] Fix issue with iOS attachments #939

Types

  • Add missing constructors for Notification, DynamicLink and RemoteMessage
react-native-firebase -

Published by chrisbianca over 6 years ago

v4.0.2 Changelog

Dynamic Links

  • [types] Add missing static Typescript types, e.g. firebase.links.DynamicLink

Firestore

  • Add support for DocumentSnapshot.get('dot.notated.field.path')

Messaging

  • [types] Add missing static Typescript types, e.g. firebase.messaging.RemoteMessage

Notifications

  • [types] Add missing static Typescript types, e.g. firebase.notifications.Notification
  • [android] Fix file:// for android notification images
  • [ios] Handle plain text alert #963
  • Make body and title optional fields
react-native-firebase -

Published by chrisbianca over 6 years ago

v4.0.1 Changelog

Admob

  • Fix contentUrl in AdRequest #955 @Bhullnatik

Analytics

  • [ios] Fix race condition with setCurrentScreen #938 @taxidermic

Notifications

  • [types] Add Typescript typings for firebase.notifications() - big thank you to @bm-software !!
  • [android] Fix Android cancelNotification #957 @matttti
  • [android] Support file:// urls for Android images
  • [android] Fix incorrect data types for choices and people #949
  • [ios] Fix crashed when notifications are received in the background on iOS 9 #952
react-native-firebase -

Published by chrisbianca over 6 years ago

v4.0.0 Changelog

TL;DR: The one everybody has been waiting for: our overhaul of messaging and notification functionality to make it more reliable, better documented and easier to use.

Plus, we've got Firebase Invites, Multi-Database url support, an overhaul of Dynamic Links and some other minor fixes.

Notification highlights:

  • Better separation of concerns: messaging, notifications and instanceid
  • Fully documented API
  • Builder classes provide a type safe way to construct messages and notifications
  • Clearer distinction between Android and IOS specific functionality
  • Support for Android Notification Channels, Android Actions and Remote Input
  • Support for BigTextStyle and BigPictureStyle Android notifications

Outstanding functionality:

  • Support for iOS notification categories

Quick Start

Install using:

npm install --save react-native-firebase@latest

Messaging

Messaging vs Notifications

We have made the conscious decision to separate this functionality into two distinct areas:

  • Messaging

    • handles remote FCM data-only messages
    • follows the official Firebase JS web SDK's messaging API where possible
  • Notifications

    • handles remote FCM notification and notification + data messages,
    • handles the display and receipt of locally displayed notifications

You can read some more here: https://rnfirebase.io/docs/v4.0.x/messaging/introduction#Message-types

Receiving messages and notifications

With our previous implementation, we had a single onMessage listener which was triggered for all messaging and notification actions, whether that was a notification in the foreground, background or even when the notification was pressed. This meant you'd have to implement some logic to check the state of the notification to try and identify what had actually happened.

To simplify things, we've broken out a number of different listeners to provide greater control and customisation:

  • Messaging
    • onMessage: Triggered when a data-only message is received remotely from FCM

Read more here: https://rnfirebase.io/docs/v4.0.x/messaging/receiving-messages

  • Notifications
    • onNotification: Triggered when a remote of local notification is received
    • onNotificationDisplayed: Triggered when a remote or local notification is displayed by the OS
      • This will typically be triggered when your app is in the background, or in the foreground if you have called firebase.notifications().displayNotification() directly.
      • The notification will have been displayed automatically to the end user by the OS
    • onNotificationOpened: Triggered when a remote or local notification is tapped / pressed / opened by the user

Read more here: https://rnfirebase.io/docs/v4.0.x/notifications/receiving-notifications and https://rnfirebase.io/docs/v4.0.x/notifications/introduction

Foreground vs Background

With our previous implementation, we relied on the show_in_foreground flag existing within the notification content to force the library to automatically show the notification if the app was running in the foreground. Whilst this (kind of) worked, it meant it was down to the notification sender to control the display of the notification, not the app itself.

The show_in_foreground flag no longer exists and instead you can use the listeners described above to give better control, e.g.

firebase.notifications().onNotification((notification: Notification) => {
  // You've received a notification that hasn't been displayed by the OS
  // To display it whilst the app is in the foreground, simply call the following
  firebase.notifications().displayNotification(notification);
});

When the app is in the background, the OS will automatically handle the notification display when a remote or local notification is received. If you wish to display a heads up notification on Android, we recommend you look at sending data only messages to your app. These can be handled when your app is in the background or closed by following the instructions here: https://rnfirebase.io/docs/v4.0.x/messaging/receiving-messages#4)-(Optional)(Android-only)-Listen-for-FCM-messages-in-the-background


Firebase Invites

We've added full support for Firebase Invites: iOS | Android


Dynamic Links

We've rolled out the Builder approach to Dynamic Links. Check out the createDynamicLink docs and Dynamic Link reference docs

This is a breaking change


Cloud Firestore

  • Added support for disableNetwork and enableNetwork
  • Added typescript definitions for Transactions

Authentication

  • Fixed issue with null photo URL when updating a user profile #911

Database

  • Fixed issue with server time offset #910
  • Database now supports using multiple database instances via database urls e.g.:
const dbShard = firebase.database('https://rnfirebase-3.firebaseio.com/');

Big shout out to @akshetpandey and @Chenjh1992 for their help getting this pushed through on #881

Crashlytics

  • Crashlytics now lives at the top level under firebase.crashlytics()

Upgrade instructions

npm install --save react-native-firebase@latest

Gradle

Due to some breaking changes in v12 of the Android libs, you'll need to upgrade your Gradle version to at least v4.4 and make a few other tweaks as follows:

  1. In android/gradle/wrapper/gradle-wrapper.properties, update the gradle URL to gradle-4.4-all.zip
  2. In android/build.gradle check that you have google() specified in the buildScript repositories section:
buildscript {
    repositories {
        jcenter()
        google()  // <-- Check this line exists
        ...
    }
  1. In android/build.gradle update Android build tools to version 3.1.0:
classpath 'com.android.tools.build:gradle:3.1.0'
  1. In android/app/build.gradle update all your compile statements to be implementation, e.g.
implementation(project(':react-native-firebase')) {
    transitive = false
}
  1. In android/app/build.gradle, update all the firebase and gms dependencies to 12.0.1

  2. When running your app from within Android Studio, you may encounter Missing Byte Code errors. This is due to a known issue with version 3.1.0 of the android tools plugin: https://issuetracker.google.com/issues/72811718. You'll need to disable Instant Run to get past this error.

Messaging / Notifications

As you can imagine, for Messaging and Notifications this is a completely breaking change, so you'll want to follow the installation instructions available here:

There are a number of guides available: Messaging | Notifications

Reference can be found here: Messaging | Notifications

Some key things to note:

  • The iOS AppDelegate.m will need to be completely updated
  • All packages in AndroidManifest.xml will need to be updated
  • firebase.messaging().requestPermissions() is now firebase.messaging().requestPermission()
  • firebase.messaging().setBadgeNumber() and firebase.messaging().getBadgeNumber() are now firebase.notifications().setBadge() and firebase.notifications().getBadge()

Dynamic Links

  • For dynamic links on iOS, you need to make a subtle change to your AppDelegate.m:
- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *, id> *)options {
    return [[RNFirebaseLinks instance] application:application openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:(void (^)(NSArray *))restorationHandler {
     return [[RNFirebaseLinks instance] application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}

Crashlytics

  • All Crashlytics methods have been moved from firebase.fabric.crashlytics() to firebase.crashlytics()

Crash Reporting

  • Crash reporting is now flagged as deprecated. We recommend you upgrade to Crashlytics which is now Firebase's recommended crash tool.

Feedback

We want your feedback!!

If you have any comments and suggestions or want to report an issue, come find us on Discord

react-native-firebase -

Published by chrisbianca over 6 years ago

See the release notes for the full v4 release

react-native-firebase -

Published by chrisbianca over 6 years ago

See the release notes for the full v4 release

react-native-firebase - v4.0.0-rc.1

Published by chrisbianca over 6 years ago

See the release notes for the full v4 release

react-native-firebase - v4.0.0-alpha.1

Published by chrisbianca over 6 years ago

See the release notes for the full v4 release

react-native-firebase -

Published by chrisbianca over 6 years ago

v3.3.1 Changelog

Types

  • Fix flow type errors with Firestore Transactions
  • Fix an incorrect flow type being returned by createUserAndRetrieveDataWithEmailAndPassword #862
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