Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
- name: Spell check
run: |
yarn lint:spellcheck
- name: Docs.page links
run: yarn lint:docs-links
# https://github.com/actions/cache/releases
- uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
name: Yarn Cache Save
Expand Down
4 changes: 2 additions & 2 deletions docs/analytics/screen-tracking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ therefore there is no "one fits all" solution to screen tracking.

The [React Navigation](https://reactnavigation.org/) library allows for various navigation techniques such as
Stack, Tab, Native or even custom navigation. The `NavigationContainer` component which the library exposes provides
access to the current navigation state when a screen changes, allowing you to use the [`logScreenView`](https://invertase.github.io/react-native-firebase/_react-native-firebase/analytics/modular/logScreenView.html)
access to the current navigation state when a screen changes, allowing you to use the [`logScreenView`](https://reference.rnfirebase.io/_react-native-firebase/analytics/index/logScreenView.html)
method the Analytics library provides:

```jsx
Expand Down Expand Up @@ -57,7 +57,7 @@ documentation on the React Navigation website.

The [`wix/react-native-navigation`](https://github.com/wix/react-native-navigation) provides 100% native platform navigation
for React Native apps. To manually track screens, you need to setup a `componentDidAppear` event listener and manually call the
[`logScreenView`](https://invertase.github.io/react-native-firebase/_react-native-firebase/analytics/modular/logScreenView.html) method the Analytics library provides:
[`logScreenView`](https://reference.rnfirebase.io/_react-native-firebase/analytics/index/logScreenView.html) method the Analytics library provides:

```js
import { getAnalytics, logScreenView } from '@react-native-firebase/analytics';
Expand Down
11 changes: 5 additions & 6 deletions docs/auth/multi-factor-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ previous: /auth/oidc-auth
---

> Before a user can enroll a second factor they need to verify their email. See
> [`User`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/User.html#sendemailverification) interface is returned.
> [`sendEmailVerification`](https://reference.rnfirebase.io/_react-native-firebase/auth/sendEmailVerification.html).

# TOTP MFA

Expand All @@ -26,7 +26,7 @@ to enable multi-factor authentication for your project and verify your app.

## Enroll a new factor

Begin by obtaining a [`MultiFactorUser`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/MultiFactorUser.html)
Begin by obtaining a [`MultiFactorUser`](https://reference.rnfirebase.io/_react-native-firebase/auth/MultiFactorUser.html)
instance for the current user. This is the entry point for most multi-factor
operations:

Expand Down Expand Up @@ -64,7 +64,7 @@ const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(cred);
await multiFactorUser.enroll(multiFactorAssertion, 'Optional display name for the user');
```

You can inspect [`User#multiFactor`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/User.html#multifactor) for
You can inspect [`User#multiFactor`](https://reference.rnfirebase.io/_react-native-firebase/auth/User.html#multifactor) for
information about the user's enrolled factors.

## Sign-in flow using phone multi-factor
Expand Down Expand Up @@ -98,7 +98,7 @@ signInWithEmailAndPassword(getAuth(), email, password)
```

Using the error object you can obtain a
[`MultiFactorResolver`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/MultiFactorResolver.html) instance and
[`MultiFactorResolver`](https://reference.rnfirebase.io/_react-native-firebase/auth/MultiFactorResolver.html) instance and
continue the flow:

```js
Expand Down Expand Up @@ -196,6 +196,5 @@ signInWithEmailAndPassword(getAuth(), email, password)
## Testing

You can define test phone numbers and corresponding verification codes. The
official[official
guide](https://cloud.google.com/identity-platform/docs/ios/mfa#enabling_multi-factor_authentication)
[official guide](https://cloud.google.com/identity-platform/docs/ios/mfa#enabling_multi-factor_authentication)
contains more information on setting this up.
4 changes: 2 additions & 2 deletions docs/auth/phone-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Ensure that all parts of step 1 and 2 from [the official firebase iOS phone auth

Phone auth requires app verification, and the automatic app verification process uses data-only firebase cloud messages to the app. Data-only cloud messaging only works on real devices where the app has background refresh enabled. If background refresh disabled, or if using the Simulator, app verification uses the fallback reCAPTCHA flow allowing you to check if it is configured correctly.

For reliable automated testing, you may want to disable both automatic and fallback reCAPTCHA app verification for your app. To do this, [you may disable app verification in AuthSettings](https://reference.rnfirebase.io/_react-native-firebase/auth/FirebaseAuthTypes/AuthSettings.html#appVerificationDisabledForTesting) prior to calling any phone auth methods.
For reliable automated testing, you may want to disable both automatic and fallback reCAPTCHA app verification for your app. To do this, [you may disable app verification in AuthSettings](https://reference.rnfirebase.io/_react-native-firebase/auth/AuthSettings.html#appverificationdisabledfortesting) prior to calling any phone auth methods.

# Android Setup

Ensure that all parts of step 1 and 2 from [the official firebase Android phone auth docs](https://firebase.google.com/docs/auth/android/phone-auth#enable-phone-number-sign-in-for-your-firebase-project) have been followed.

To bypass Play Integrity for manual testing, you may [force reCAPTCHA to be used](https://reference.rnfirebase.io/_react-native-firebase/auth/FirebaseAuthTypes/AuthSettings.html#appVerificationDisabledForTesting) prior to calling [`verifyPhoneNumber`](https://reference.rnfirebase.io/_react-native-firebase/auth/verifyPhoneNumber.html).
To bypass Play Integrity for manual testing, you may [force reCAPTCHA to be used](https://reference.rnfirebase.io/_react-native-firebase/auth/AuthSettings.html#appverificationdisabledfortesting) prior to calling [`verifyPhoneNumber`](https://reference.rnfirebase.io/_react-native-firebase/auth/verifyPhoneNumber.html).

# Expo Setup

Expand Down
8 changes: 4 additions & 4 deletions docs/auth/usage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function App() {
```

If the `user` returned within the handler is `null` we assume the user is currently signed-out, otherwise they are
signed-in and a [`User`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/User.html) interface is returned.
signed-in and a [`User`](https://reference.rnfirebase.io/_react-native-firebase/auth/User.html) interface is returned.

The `onAuthStateChanged` method also returns an unsubscriber function which allows us to stop listening for events whenever
the hook is no longer in use.
Expand Down Expand Up @@ -134,7 +134,7 @@ signInAnonymously(getAuth())
```

Once successfully signed in, any [`onAuthStateChanged`](/auth/usage#listening-to-authentication-state) listeners will trigger an event
with the [`User`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/User.html) details.
with the [`User`](https://reference.rnfirebase.io/_react-native-firebase/auth/User.html) details.

In case any errors occur, the module provides support for identifying what specifically went wrong by attaching a code
to the error. For a full list of error codes available, view the [Firebase documentation](https://firebase.google.com/docs/reference/js/auth.md#autherrorcodes).
Expand Down Expand Up @@ -171,14 +171,14 @@ createUserWithEmailAndPassword(getAuth(), 'jane.doe@example.com', 'SuperSecretPa
```

Once successfully created and/or signed in, any [`onAuthStateChanged`](/auth/usage#listening-to-authentication-state) listeners will trigger an event
with the [`User`](https://invertase.github.io/react-native-firebase/_react-native-firebase/auth/FirebaseAuthTypes/User.html) details.
with the [`User`](https://reference.rnfirebase.io/_react-native-firebase/auth/User.html) details.

In case any errors occur, the module provides support for identifying what specifically went wrong by attaching a code
to the error. For a full list of error codes available, view the [Firebase documentation](https://firebase.google.com/docs/reference/js/auth.md#autherrorcodes).

## Authenticate with backend server

The user's token should be used for authentication with your backend systems. The token is fetched with the [getIdToken](https://reference.rnfirebase.io/_react-native-firebase/auth/FirebaseAuthTypes/User.html#getIdToken) method. As mentioned in the [Firebase documentation](https://firebase.google.com/docs/auth/web/manage-users#get_a_users_profile), the uid should not be used for authentication.
The user's token should be used for authentication with your backend systems. The token is fetched with the [getIdToken](https://reference.rnfirebase.io/_react-native-firebase/auth/getIdToken.html) method. As mentioned in the [Firebase documentation](https://firebase.google.com/docs/auth/web/manage-users#get_a_users_profile), the uid should not be used for authentication.

## Signing out

Expand Down
4 changes: 2 additions & 2 deletions docs/database/presence-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ If the device suddenly goes offline, or is quit, the app can no longer execute c
Realtime Database API provides a way to execute code on the Firebase servers whenever the connection between an app & server
is lost.

The `onDisconnect` function returns a new [`OnDisconnect`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/OnDisconnect.html) instance. This instance
The `onDisconnect` function returns a new [`OnDisconnect`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/OnDisconnect.html) instance. This instance
provides functionality to remove or set data whenever a client disconnects. Using the
[`remove`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/OnDisconnect.html#remove) method we can remove the node on the database if the client disconnects:
[`remove`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/OnDisconnect.html#remove) method we can remove the node on the database if the client disconnects:

```jsx
import React, { useEffect } from 'react';
Expand Down
10 changes: 5 additions & 5 deletions docs/database/usage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To learn more, view the [Firebase Realtime Database documentation](https://fireb
A core concept to understanding Realtime Database are references - a reference to a specific node within your database. A node
can be a specific property or sub-nodes.

To create a [`Reference`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/Reference.html), use the `ref` function:
To create a [`Reference`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/DatabaseReference.html), use the `ref` function:

```js
import { getDatabase, ref } from '@react-native-firebase/database';
Expand All @@ -71,7 +71,7 @@ const reference = ref(db, '/users/123');
## Reading data

The Realtime Data provides the ability to read the value of a reference as a one-time read, or realtime changes to the node.
When a value is read from the database, the API returns a [`DataSnapshot`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/DataSnapshot.html).
When a value is read from the database, the API returns a [`DataSnapshot`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/DataSnapshot.html).

The snapshot includes information such as whether the reference node exists, it's value or any children the node has and more.

Expand Down Expand Up @@ -128,7 +128,7 @@ function User({ userId }) {

The above example demonstrates how to subscribe to events whenever a value within the node changes. In some cases, you
may need to only subscribe to events whenever a child node is added/changed/moved/removed. This can be achieved using
a different listener such as [`onChildAdded`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/EventType.html).
a different listener such as [`onChildAdded`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/EventType.html).

If you are listening to a node with many children, only listening to data you care about helps reduce network bandwidth
and speeds up your application.
Expand Down Expand Up @@ -253,7 +253,7 @@ update(ref(db, '/users/123'), {

Currently the examples have only demonstrated working with known reference node keys (e.g. `/users/123`). In some cases,
you may not have a suitable id or may want Firebase to automatically create a node with a generated key. The `push` function
returns a [`ThenableReference`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/ThenableReference.html), allowing you to observe a node before it is
returns a [`ThenableReference`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/ThenableReference.html), allowing you to observe a node before it is
sent to remote Firebase database.

`push` will automatically generate a new key if one is not provided:
Expand Down Expand Up @@ -329,7 +329,7 @@ onPostLike('567').then(transaction => {
```

Once the transaction is successful, a promise is resolved with a value containing whether the operation committed on the remote
database and the new [`DataSnapshot`](https://invertase.github.io/react-native-firebase/_react-native-firebase/database/FirebaseDatabaseTypes/DataSnapshot.html) containing the new value.
database and the new [`DataSnapshot`](https://reference.rnfirebase.io/_react-native-firebase/database/types/database/DataSnapshot.html) containing the new value.

# Securing data

Expand Down
Loading
Loading