🔥 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 hidden (Show)
Published by Salakar over 6 years ago
TL;DR: Main focus of this release is Cloud Firestore Transaction support + minor bug fixes and SDK version upgrades.
firestore.runTransaction()
- Implemented transaction supportanalytics.logEvent()
- added additional argument validations (fixes #846)reauthenticateAndRetrieveDataWithCredential
native methodsPublished by Salakar over 6 years ago
Thanks to everybody for the feedback on our flow type changes. We've made a couple of tweaks to prevent internal errors from filtering through to your apps.
We've added better support for Flow by exporting the following types:
Core: App
Auth: ActionCodeInfo
, ActionCodeSettings
, AdditionalUserInfo
, AuthCredential
, ConfirmationResult
, User
, UserCredential
, UserInfo
and UserMetadata
Database: DataSnapshot
, OnDisconnect
, Reference
, Query
as DataQuery
Firestore: CollectionReference
, DocumentChange
, DocumentListenOptions
, DocumentReference
, DocumentSnapshot
, FieldPath
, FieldValue
, GeoPoint
, Query
, QueryListenOptions
, QuerySnapshot
, SetOptions
, SnapshotMetadata
and WriteBatch
We will add types for the other modules as we tidy them up.
You can import a type by doing the following:
import type { App } from 'react-native-firebase';
At the moment, we're building and bundling the Flow types alongside our source code as part of the npm module. This makes it easier to keep up to date, but does cause some issues with different versions of Flow.
Another approach would be to start exporting libdefs to the flow-typed
repository. This is a bit more involved and requires that you set up flow-typed
in your projects, but would allow us to be a bit more flexible with the flow types and hide some of the internals.
So what do you think? Please let us know over on Discord: https://discord.gg/C9aK28N
getCurrentUser
- replace with firebase.auth().currentUser
insteadlanguageCode
to Auth
class #655createUserAndRetrieveDataWithEmailAndPassword
, signInAndRetrieveDataWithCredential
, signInAndRetrieveDataWithCustomToken
, signInAndRetrieveDataWithEmailAndPassword
and signInAnonymouslyAndRetrieveData
methods to Auth
class.createUserWithEmailAndPassword
, signInAndRetrieveDataWithCredential
, signInAndRetrieveDataWithCustomToken
, signInAndRetrieveDataWithEmailAndPassword
and signInAnonymouslyAndRetrieveData
methods have been deprecated and will be removed in a future version.verifyPasswordResetCode
method to Auth
classmetadata
property to User
classlinkAndRetrieveDataWithCredential
and reauthenticateAndRetrieveDataWithCredential
to User
class.linkWithCredential
and reauthenticateWithCredential
methods have been deprecated and will be removed in a future version.OAuthProvider
and OAuthCredential
false
query optionsshow_in_foreground
flag #740use_frameworks!
supportAlthough use_frameworks!
was working in the simplest cases, there were still some issues if it was used in a project that had React
installed as a Pod rather than as a linked library.
This release adds some additional search paths to better support this use case. You will also need to make the following changes:
This will ensure that the Pods are built before react-native-firebase
and the headers are available for it to build successfully.
Due to changes in React Native 0.50.0, react-native link
wasn't working properly with react-native-firebase on iOS (more info here). To resolve these issues we have moved the Podspec
file to the ios
directory.
If you are using react-native-firebase
as a Pod (which is no longer our recommended approach) you will have to update the definition in your Podfile to:
pod 'RNFirebase', :path => '../../ios/RNFirebase.podspec'
use_frameworks!
supportIn the past there have been issues with using react-native-firebase
when use_frameworks!
is set in your Podfile. Going forward, this is now supported but only if have linked using react-native link
and not if you are specifying react-native-firebase
in your Podfile.
Defining react-native-firebase
in your Podfile is no longer our recommended approach, so we suggest you remove references to it from your Podfile and run react-native link react-native-firebase
instead.
NOTE: We still recommend installing the underlying Firebase SDKs using Cocoapods as specified in our installation instructions
npm install react-native-firebase@latest
ios/Pods
directory and re-run pod install
.react-native run-android
confirmPasswordReset
, applyActionCode
and checkActionCode
not handling specific app instancesupdatePassword
not correctly using the app instancefirebase.database.enableLogging
firebase.database().setPersistenceCacheSizeBytes
firebase.firestore.enableLogging
startTraceWithName
instead of just traceWithName
#593Published by Salakar almost 7 years ago
where
clause - https://github.com/invertase/react-native-firebase/commit/6ae004933867ffc8bb40fbe584ee49ed3c90d61b
putFile
issue with content://
paths - https://github.com/invertase/react-native-firebase/issues/572
RNFirebaseStorage.m
compilation issue - https://github.com/invertase/react-native-firebase/pull/570
We're now on Open Collective - see the readme section for or visit https://opencollective.com/react-native-firebase if you'd like to support ongoing development and maintenance of this library.
npm install react-native-firebase@latest
ios/Pods
directory and re-run pod install
.react-native run-android
verifyPhoneNumber
onUserChanged
method to simplify integration with React Nativeundefined
valuesfacebook.com
, google.com
, github.com
, twitter.com
Published by Salakar about 7 years ago
react-native link
is now supported, which means the following:
react-native-firebase
, etc installed as pods. You do still need to have the Firebase SDKs installed as Pods as recommended by Google.Check out the new installation guides:
We've added a new module to contain everything non-firebase specific, things that relate to the library (such as configuration) or using firebase on react native and misc debug helpers.
Accessing the new module can be done via firebase.utils().X
or firebase.utils.X
for statics.
firebase.utils().playServicesAvailability
returns an object of type GoogleApiAvailabilityType
@salakarfirebase.utils().errorOnMissingPlayServices
set to true
or false
. Defaults to true, with this enabled a red box Play Services error will appear if the device you're developing your android app on has failed the Play Services checks. You should set this to false
in your prod app and handle Play Services checks yourself using the provided apis on utils()
. @salakarfirebase.utils().promptOnMissingPlayServices
set to true
or false
. Defaults to true, with this enabled if a Play Services issue is detected it will automatically attempt to prompt you on screen to update the Play Services app (i.e update dialog with update button) or whatever the possible resolution is. Set to false
to disable. @salakarpromptForPlayServices()
, resolutionForPlayServices()
, makePlayServicesAvailable()
@salakarThe old docs for Google Play Services api's can be found here - they generally still stand except for the api now being as above.
See https://github.com/invertase/react-native-firebase/blob/master/lib/modules/utils/index.js for any other undocumented methods.
onSnapshot
parameter options - @chrisbianca https://github.com/invertase/react-native-firebase/commit/2575fb49567da2ce767e0674df018b94544f773e
update
parameter options - @chrisbianca https://github.com/invertase/react-native-firebase/commit/46136e6c4d19fc772fa34da2c091100366d2ff49
We're aware there's a lot of missing docs on the current site and this something we're actively working on improving. We have a brand new work in progress site, it has guides, full api references and more, let us know your thoughts (on discord): https://invertase-default.firebaseapp.com/docs/v3.0.*/getting-started - this is a temporary url. If you'd like to get involved and contribute to the site then please let us know (also on discord).
v3 change log added below for completeness.
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.
See: http://invertase.link/v2-v3
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).
new RNFirebase()
is no longer supported. See below for information about app initialisation.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.
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.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.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 (coming soon):
app.onReady(): Promise
and why it's needed for JS initialised apps.firebase.SDK_VERSION
firebase.DEFAULT_APP_NAME
auth()
now supports passing an instance of App as the first argumentproviderId
rather than provider
as per the Web SDK. If you are manually creating your credentials, you will need to update the field name.database()
now supports passing an instance of App as the first argumentonce
now supports context
as per the web sdkremove
now supports onComplete callbacks (and promises) as per the web sdkupdate
now supports onComplete callbacks (and promises) as per the web sdksetWithPriority
now supports onComplete callbacks (and promises) as per the web sdksetPriority
now supports onComplete callbacks (and promises) as per the web sdkset
now supports onComplete callbacks (and promises) as per the web sdkkeepSynced
now correctly takes into account query modifiers natively, was ignoring these beforetransaction
implementations to have better error handling and timeout checks (mainly for whilst running in dev)
The transaction was overridden by a subsequent set. (database/overridden-by-set)
instead.onDisconnectUpdate
method. See #272.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.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.ThenableReference
support implemented, for now this is just for .push()
. See #147.storage()
now supports passing an instance of App as the first argumentputFile
now sets the remote file content/type
automatically for images and videos (Android TODO)downloadUrl
renamed to downloadURL
to match web sdkApache License 2.0
to license this library.As these aren't major issues we've decided that they shouldn't hold back the release of v3,
Published by Salakar about 7 years ago