From 7bc68339bf8bac5c793f723fbbd283e73bcb7779 Mon Sep 17 00:00:00 2001 From: toyeshhm Date: Sat, 5 Sep 2026 00:12:05 -0500 Subject: [PATCH 1/2] docs: replace missing utils export with getUtils and FilePath in examples docs/app/utils.mdx and docs/storage/usage/index.mdx import `utils` from `@react-native-firebase/app`, but the package has no runtime export by that name. packages/app/lib/index.ts re-exports ./modular, which exposes getUtils(app?) and the FilePath constant; `Utils` is a type-only export. The samples now use those, matching the v26 migration guide. Also fixes two typos: "emojii" in the bug report template and "fom" in the messaging usage doc. --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- docs/app/utils.mdx | 26 +++++++++++++------------- docs/messaging/usage/index.mdx | 2 +- docs/storage/usage/index.mdx | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index e178ae8537..86151153f2 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -171,7 +171,7 @@ Describe your issue here - + --- diff --git a/docs/app/utils.mdx b/docs/app/utils.mdx index 4b482c31b6..92e18b0495 100644 --- a/docs/app/utils.mdx +++ b/docs/app/utils.mdx @@ -14,12 +14,12 @@ When working with modules such as [Cloud Storage](/storage), you may need to kno current directory paths. Rather than installing a separate module, the library provides useful statics which can be used. -Access the `FilePath` static via utils: +Import `FilePath` directly from the app package: ```js -import { utils } from '@react-native-firebase/app'; +import { FilePath } from '@react-native-firebase/app'; -console.log(utils.FilePath.PICTURES_DIRECTORY); +console.log(FilePath.PICTURES_DIRECTORY); ``` # Test Lab @@ -35,11 +35,11 @@ data collection. Such functionality can be carried out by taking advantage of th > Be aware, `isRunningInTestLab` is Android only property! ```js -import { utils } from '@react-native-firebase/app'; +import { getUtils } from '@react-native-firebase/app'; import { getAnalytics, setAnalyticsCollectionEnabled } from '@react-native-firebase/analytics'; async function bootstrap() { - if (utils().isRunningInTestLab) { + if (getUtils().isRunningInTestLab) { await setAnalyticsCollectionEnabled(getAnalytics(), false); } } @@ -55,9 +55,9 @@ separate package. > it is `undefined` (including when the native value is empty). ```js -import { utils } from '@react-native-firebase/app'; +import { getUtils } from '@react-native-firebase/app'; -const version = utils().appVersion; +const version = getUtils().appVersion; if (version) { console.log('App version:', version); } @@ -68,11 +68,11 @@ if (version) { It is useful to know if the Android device has play services available, and what to do in response to certain use cases: ```js -import { utils } from '@react-native-firebase/app'; +import { getUtils } from '@react-native-firebase/app'; async function checkPlayServicesExample() { const { status, isAvailable, hasResolution, isUserResolvableError } = - utils().playServicesAvailability; + getUtils().playServicesAvailability; // all good and valid \o/ if (isAvailable) return Promise.resolve(); // if the user can resolve the issue i.e by updating play services @@ -83,19 +83,19 @@ async function checkPlayServicesExample() { // SERVICE_MISSING - Google Play services is missing on this device. // show something to user // and then attempt to install if necessary - return utils().makePlayServicesAvailable(); + return getUtils().makePlayServicesAvailable(); case 2: // SERVICE_VERSION_UPDATE_REQUIRED - The installed version of Google Play services is out of date. // show something to user // and then attempt to update if necessary - return utils().resolutionForPlayServices(); + return getUtils().resolutionForPlayServices(); default: // some default dialog / component? // use the link below to tailor response to status codes to suit your use case // https://developers.google.com/android/reference/com/google/android/gms/common/ConnectionResult#SERVICE_VERSION_UPDATE_REQUIRED - if (isUserResolvableError) return utils().promptForPlayServices(); - if (hasResolution) return utils().resolutionForPlayServices(); + if (isUserResolvableError) return getUtils().promptForPlayServices(); + if (hasResolution) return getUtils().resolutionForPlayServices(); } } // There's no way to resolve play services on this device diff --git a/docs/messaging/usage/index.mdx b/docs/messaging/usage/index.mdx index 695e08a4b1..dc5b727414 100644 --- a/docs/messaging/usage/index.mdx +++ b/docs/messaging/usage/index.mdx @@ -435,7 +435,7 @@ import { getMessaging, unsubscribeFromTopic } from '@react-native-firebase/messa const messaging = getMessaging(); -unsubscribeFromTopic(messaging, 'weather').then(() => console.log('Unsubscribed fom the topic!')); +unsubscribeFromTopic(messaging, 'weather').then(() => console.log('Unsubscribed from the topic!')); ``` # firebase.json diff --git a/docs/storage/usage/index.mdx b/docs/storage/usage/index.mdx index 19f1f00be7..5ea456c66d 100644 --- a/docs/storage/usage/index.mdx +++ b/docs/storage/usage/index.mdx @@ -80,7 +80,7 @@ library provides [Utils](/app/utils) to help identify device directories: import React, { useEffect } from 'react'; import { View, Button } from 'react-native'; -import { utils } from '@react-native-firebase/app'; +import { FilePath } from '@react-native-firebase/app'; import { getStorage, ref, putFile } from '@react-native-firebase/storage'; function App() { @@ -91,7 +91,7 @@ function App() {