π₯ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
OTHER License
Bot releases are visible (Hide)
Reference.toString()
incorrectly contains //
instead of /
when joining the parent and child paths..push()
behaviour to match WebSDK and correctly return a Reference instance in all scenarios. (Fixes #893 #1464 #1572).null
within getDownloadUrl
now successfully resolves.firebase.utils().database.cleanup()
utility method which removes all database listeners.getAPNSToken
method. https://github.com/invertase/react-native-firebase/pull/1626 @timwangdevregisterForRemoteNotifications
method. https://github.com/invertase/react-native-firebase/pull/1626 @timwangdevPlease 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.
yarn add [email protected]
or
npm install [email protected]
NoSuchMethodError
exceptions on < API 26
(#1550 #1549 #1553 #1399)WeakReference
to keep ref to Context (avoids mem leaks)removeDeliveredNotificationsByTag
now correctly removes #1546removeDeliveredNotificationsByTag
crash #1392toJSON()
to match web sdkNonNull
& Nullable
annotation instances with java annotations
createShortDynamicLink
- #1580functions
type #1533module-resolver
bug - #1560v5.10.0
3.2.0
classpath 'com.android.tools.build:gradle:3.2.0'
28.0.2
play-services-base
to 16.0.1
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'
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
Published by Salakar about 6 years ago
See the website for release notes: https://rnfirebase.io/docs/v5.x.x/release-notes
Published by Salakar about 6 years ago
Big thanks to all the contributors who helped submit the below changes / report the bugs π
Loving react-native-firebase
and the support we provide? Please consider supporting us with any of the below:
React Native Firebase
and Invertase
on TwitterPublished by Salakar over 6 years ago
As always - huge thanks to all our contributors and everyone that has helped debug issues.
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/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
}
// 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 --------------------------- /\
// ...
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'
# ...
ForceResendingToken
, closes #721
signInAndRetrieveDataWithCredential()
when using twitter auth #1249GetOptions
#1248getToken(string,string)
and deleteToken(string,string)
- https://github.com/invertase/react-native-firebase/pull/1215
setDefaults
on Notifications. #1235areNotificationsEnabled
#1164Notification
setProgress
not working #1167AndroidNotification
#1221Android.Importance.None
#1220decodeURI
'ing on file pathLoving react-native-firebase
and the support we provide? Please consider supporting us with any of the below:
React Native Firebase
and Invertase
on TwitterPublished by chrisbianca over 6 years ago
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.
This version supports v5+ of the Firebase iOS pods which contained a number of breaking changes"
Firebase/Core
to 4.13.0
, you will need to remove that restriction.pod update
to get the latest versions of all the Firebase pods.fetchSignInMethodsForEmail
, isSignInWithEmailLink
, sendSignInLinkToEmail
and signInWithEmailLink
Published by chrisbianca over 6 years ago
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'
android/app/build.gradle
You need to be using at least the following versions of the firebase and gms imports:
DocumentListenOptions
and QueryListenOptions
objects passed into DocumentReference.onSnapshot
and CollectionReference.onSnapshot
have been updated to use a single MetadataChanges
objectincludeDocumentMetadataChanges
and includeQueryMetadataChanges
flags, then they need to be merged into a single includeMetadataChanges
flag insteadPublished by chrisbianca over 6 years ago
Published by chrisbianca over 6 years ago
onAuthStateChanged
.where
TypeScript typings - thanks @awmichelPublished by Salakar over 6 years ago
Published by Salakar over 6 years ago
firebase.firestore().settings()
- psst, this allows you to disable persistence ;-)firebase.firestore().setLogLevel()
data()
and get()
messaging_token_refreshed
warning #960firebase.links.DynamicLink
DocumentSnapshot.get('dot.notated.field.path')
firebase.messaging.RemoteMessage
firebase.notifications.Notification
setCurrentScreen
#938 @taxidermicfirebase.notifications()
- big thank you to @bm-software !!cancelNotification
#957 @mattttiTL;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:
messaging
, notifications
and instanceid
Outstanding functionality:
Install using:
npm install --save react-native-firebase@latest
We have made the conscious decision to separate this functionality into two distinct areas:
Messaging
Notifications
You can read some more here: https://rnfirebase.io/docs/v4.0.x/messaging/introduction#Message-types
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:
onMessage
: Triggered when a data-only message is received remotely from FCMRead more here: https://rnfirebase.io/docs/v4.0.x/messaging/receiving-messages
onNotification
: Triggered when a remote of local notification is received
firebase.notifications().displayNotification()
: https://rnfirebase.io/docs/v4.0.x/notifications/displaying-notifications
onNotificationDisplayed
: Triggered when a remote or local notification is displayed by the OS
firebase.notifications().displayNotification()
directly.onNotificationOpened
: Triggered when a remote or local notification is tapped / pressed / opened by the user
firebase.notifications().getInitialNotification()
will be populated with this information when the app is started by a notification being opened.Read more here: https://rnfirebase.io/docs/v4.0.x/notifications/receiving-notifications and https://rnfirebase.io/docs/v4.0.x/notifications/introduction
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
We've added full support for Firebase Invites: iOS | Android
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
disableNetwork
and enableNetwork
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
firebase.crashlytics()
npm install --save react-native-firebase@latest
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:
android/gradle/wrapper/gradle-wrapper.properties
, update the gradle URL to gradle-4.4-all.zip
android/build.gradle
check that you have google()
specified in the buildScript repositories section:buildscript {
repositories {
jcenter()
google() // <-- Check this line exists
...
}
android/build.gradle
update Android build tools to version 3.1.0
:classpath 'com.android.tools.build:gradle:3.1.0'
android/app/build.gradle
update all your compile
statements to be implementation
, e.g.implementation(project(':react-native-firebase')) {
transitive = false
}
In android/app/build.gradle
, update all the firebase and gms dependencies to 12.0.1
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.
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:
AppDelegate.m
will need to be completely updatedAndroidManifest.xml
will need to be updatedfirebase.messaging().requestPermissions()
is now firebase.messaging().requestPermission()
firebase.messaging().setBadgeNumber()
and firebase.messaging().getBadgeNumber()
are now firebase.notifications().setBadge()
and firebase.notifications().getBadge()
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];
}
firebase.fabric.crashlytics()
to firebase.crashlytics()
We want your feedback!!
If you have any comments and suggestions or want to report an issue, come find us on Discord
See the release notes for the full v4 release
See the release notes for the full v4 release
Published by chrisbianca over 6 years ago
See the release notes for the full v4 release
Published by chrisbianca over 6 years ago
See the release notes for the full v4 release