Skip to content

Releases: invertase/react-native-firebase

v4.0.4

17 Apr 18:08
Compare
Choose a tag to compare

v4.0.4 Changelog

Firestore

  • [js] settings() - use hasOwnProperty instead of truthy value existence checks f483241
  • [js] fix incomplete transaction error stack 88410b4

Notifications

  • [android] allow using ringtones from RingtoneManager 546e3f5 - thanks @giladno

Types / Flow

  • [notifications] fix misc typescript issues c275e02
  • [database] fix misc flow issue 5589ed7

v4.0.3

13 Apr 14:20
Compare
Choose a tag to compare

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

v4.0.2

12 Apr 16:40
Compare
Choose a tag to compare

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

v4.0.1

10 Apr 15:37
Compare
Choose a tag to compare

v4.0.1 Changelog

Admob

Analytics

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

v4.0.0

05 Apr 16:47
Compare
Choose a tag to compare

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 ...
Read more

v4.0.0-rc.3

28 Mar 16:29
Compare
Choose a tag to compare
v4.0.0-rc.3 Pre-release
Pre-release

See the release notes for the full v4 release

v4.0.0-rc.2

23 Mar 17:54
Compare
Choose a tag to compare
v4.0.0-rc.2 Pre-release
Pre-release

See the release notes for the full v4 release

v4.0.0-rc.1

23 Mar 17:46
Compare
Choose a tag to compare
v4.0.0-rc.1 Pre-release
Pre-release

See the release notes for the full v4 release

v4.0.0-alpha.1

20 Mar 09:00
Compare
Choose a tag to compare
v4.0.0-alpha.1 Pre-release
Pre-release

See the release notes for the full v4 release

v3.3.1

08 Mar 11:40
Compare
Choose a tag to compare

v3.3.1 Changelog

Types

  • Fix flow type errors with Firestore Transactions
  • Fix an incorrect flow type being returned by createUserAndRetrieveDataWithEmailAndPassword #862