### Install and Run Firestore Emulator Source: https://rnfirebase.io/firestore/emulator Install the Firebase CLI and start the Firestore emulator. This command will also install the emulator if it's your first time running it. ```bash curl -sL firebase.tools | bash firebase emulators:start --only firestore ``` -------------------------------- ### Install App Distribution Module Source: https://rnfirebase.io/app-distribution/usage Install the core app module and the app-distribution module. For iOS development, ensure you run `pod install` after installation. ```bash # Install & setup the app module yarn add @react-native-firebase/app # Install the app-distribution module yarn add @react-native-firebase/app-distribution # If you're developing your app using iOS, run this command cd ios/ && pod install ``` -------------------------------- ### Install React Native Firebase Performance Monitoring Source: https://rnfirebase.io/perf/usage Install the app and performance monitoring modules. For iOS, run `pod install` in the `ios` directory. ```bash # Install & setup the app module yarn add @react-native-firebase/app # Install the performance monitoring module yarn add @react-native-firebase/perf # If you're developing your app using iOS, run this command cd ios/ && pod install ``` -------------------------------- ### Installation Source: https://rnfirebase.io/in-app-messaging/usage Instructions for installing the In-App Messaging module along with its dependencies. ```APIDOC ## Installation This module requires that the `@react-native-firebase/app` module is already setup and installed. To install the "app" module, view the Getting Started documentation. This module also requires that the `@react-native-firebase/analytics` module is already setup and installed. To install the "analytics" module, view it's Getting Started documentation. ```bash # Install & setup the app module yarn add @react-native-firebase/app # Install the in-app-messaging module yarn add @react-native-firebase/in-app-messaging # If you're developing your app using iOS, run this command cd ios/ && pod install ``` Note: in-app-messaging requires a minimum android gradle plugin version of 3.5.4 to compile or you will see `AAPT` errors regarding unexpected XML with `` elements. However, `react-native@0.63.4` still ships with a default of 3.5.3. If you have not already, you must update the line `classpath("com.android.tools.build:gradle:3.5.3")`in `android/build.gradle` to a minimum of `3.5.4` for android builds to work. If you're using an older version of React Native without autolinking support, or wish to integrate into an existing project, you can follow the manual installation steps for iOS and Android. ``` -------------------------------- ### Install React Native Firebase App and Installations Modules Source: https://rnfirebase.io/installations/usage Install the core '@react-native-firebase/app' module first, then add the '@react-native-firebase/installations' module. For iOS development, navigate to the 'ios' directory and run 'pod install'. ```bash # Install & setup the app module yarn add @react-native-firebase/app # Install the installations module yarn add @react-native-firebase/installations # If you're developing your app using iOS, run this command cd ios/ && pod install ``` -------------------------------- ### Implement Pagination with Firestore Source: https://rnfirebase.io/firestore/pagination This example shows how to fetch data in pages from Firestore. It uses `orderBy` to sort the data, `startAfter` to specify the starting point for the next page, and `limit` to control the page size. The `lastDocument` state variable keeps track of the last document fetched to enable fetching subsequent pages. ```javascript import React, { useState } from 'react'; import type { Node } from 'react'; import { Text, View, Button, Alert } from 'react-native'; import firestore from '@react-native-firebase/firestore'; const userCollection = firestore().collection('Users'); const App: () => Node = () => { const [lastDocument, setLastDocument] = useState(); const [userData, setUserData] = useState([]); function LoadData() { console.log('LOAD'); let query = userCollection.orderBy('age'); // sort the data if (lastDocument !== undefined) { query = query.startAfter(lastDocument); // fetch data following the last document accessed } query.limit(3) // limit to your page size, 3 is just an example .get() .then(querySnapshot => { setLastDocument(querySnapshot.docs[querySnapshot.docs.length - 1]); MakeUserData(querySnapshot.docs); }); } } function MakeUserData(docs) { let templist = []; docs.forEach((doc, i) => { console.log(doc._data); let temp = ( {doc._data.name} {doc._data.age} ); templist.push(temp); }); setUserData(templist); } return ( {userData}