🔥 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 about 7 years ago
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:
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,
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)
setPriority
and setWithPriority
methodsView build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
didReceiveNotificationResponse
and willPresentNotification
View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)
Published by Salakar over 7 years ago
firebase.auth().currentUser.unlink(providerId: string): Promise<FirebaseUser>
View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)
Published by Salakar over 7 years ago
confirmPasswordReset
methodapplyActionCode
methodcheckActionCode
methodMisc 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)
Published by Ehesp over 7 years ago
openDebugMenu
functionality (@ehesp https://github.com/invertase/react-native-firebase/commit/c22fb3911fc5043ee995b599f662ea5e741634a6)child_added
for example) - not just 'value'. (@Salakar https://github.com/invertase/react-native-firebase/commit/2f67e8b35b41f7790115eeaade2b5729c46eb41b)database.ServerValue.TIMESTAMP
(@agentilela https://github.com/invertase/react-native-firebase/commit/bc2f2c4317ef826a5ded5e5b2cce9fa378ea9e8e)View build details and download artifacts on buddybuild:
ReactNativeFirebaseDemo (iOS, ReactNativeFirebaseDemo)
ReactNativeFirebaseDemo (Android)
View build details and download artifacts on buddybuild:
Published by Salakar over 7 years ago
Published by Ehesp over 7 years ago
A guide to upgrading from v1 to v2 can be found on the docs here.
Version 2.0.0 of RNFirebase introduces new features, breaking changes, deprecations (matching v4 of the web SDK) and general build / dependency improvements.
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:
boolean
)string
): Trace
Trace
.start(): void
Trace
.incrementCounter(event: string
): void
Trace
.stop(): void
Promise<Array<String>>
implementedonAuthStateChange
returned a different result on state changes.providerId
should now be used instead of provider
whilst obtaining auth credentials. The latter will be removed in future releases.User.getToken
in favour of User.getIdToken
.User.reauthenticate
has been removed in favour of User.reauthenticateWithCredential
.User.link
has been removed in favour of User.linkWithCredential
.didReceiveNotificationResponse
and willPresentNotification
methods for iOS messaging. Added additional didReceiveRemoteNotification
method.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()
);
}
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.
Published by Ehesp over 7 years ago
These release notes cover the major changes for versions v1.0.2...v1.1.0
Remote config has been implemented on both Android & iOS (@akshetpandey)
Published by Salakar over 7 years ago
This change log includes changes for alpha14 + v1.0.1 releases.
startAt
and endtAt
query modifiers. https://github.com/invertase/react-native-firebase/commit/7c9b094f549c2591ed75931b751b0a20e0558876
limitToLast
query modifier.https://github.com/invertase/react-native-firebase/commit/b4622006bfe99f69125540b73ae81ae0e570956e
Published by chrisbianca over 7 years ago
[ios] Fixed CrashReporting imports
[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()
[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
[js][android] Use GoogleApiAvailability to prompt the user to install Google Play Services if it is not installed
[storage] upload/download task promises implementation currently WIP and may break if used, use the event callbacks instead.
Published by Salakar over 7 years ago
Published by Salakar over 7 years ago
forceRefresh
boolean arg. https://github.com/invertase/react-native-firebase/commit/48e57d2065541ed55725e7ee1a915fdc8100de47
Published by Salakar over 7 years ago
And misc docs from @Ehesp and @chrisbianca
Published by Salakar over 7 years ago
Big feature landed, brace yourself...
Published by Salakar over 7 years ago
storage/unauthorized
firebase.database().ServerValue
moved to firebase.database.ServerValue
firebase.storage.TaskState
enumsfirebase.storage.TaskEvent
enumsfirebase.storage().constants
to firebase.storage.Native
to match other enumsNote: Android storage is currently broken due to the js updates, will fix this in alpha9 in the next day or so.