mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-07 09:27:42 +08:00
Update utils docs
This commit is contained in:
@@ -257,7 +257,3 @@
|
||||
to: '/'
|
||||
- text: Quick Start
|
||||
to: '/quick-start'
|
||||
- text: Android Setup
|
||||
to: '/android'
|
||||
- text: iOS Setup
|
||||
to: '/ios'
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Android Setup
|
||||
description: Manually integrate Utils into your Android application.
|
||||
---
|
||||
|
||||
# Android Manual Linking
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
> auto-linking.
|
||||
|
||||
## TODO
|
||||
@@ -17,7 +17,7 @@ development of the React Native Firebase library.
|
||||
title="Quick Start"
|
||||
to="/quick-start"
|
||||
>
|
||||
Install & integrate the utils functionality into your app or tests.
|
||||
Start using the utilities in your own application.
|
||||
</Block>
|
||||
<Block
|
||||
icon="layers"
|
||||
@@ -25,6 +25,6 @@ development of the React Native Firebase library.
|
||||
title="Reference"
|
||||
to="/reference"
|
||||
>
|
||||
The API reference covers everything required to successfully monitor your apps performance.
|
||||
The API reference covers everything required to use the utils within your own application.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: iOS Setup
|
||||
description: Manually integrate Utils into your iOS application.
|
||||
---
|
||||
|
||||
# iOS Manual Linking
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
> auto-linking.
|
||||
|
||||
## TODO
|
||||
@@ -5,28 +5,14 @@ description: Getting started with the Utils package in React Native Firebase
|
||||
|
||||
# Utils Quick Start
|
||||
|
||||
## Installation
|
||||
|
||||
Install this module with Yarn:
|
||||
|
||||
```bash
|
||||
yarn add @react-native-firebase/utils
|
||||
```
|
||||
|
||||
> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
|
||||
The utils module comes installed with the `app` module.
|
||||
|
||||
## Module usage
|
||||
|
||||
Import the Performance Monitoring package into your project:
|
||||
Import the Utils package into your project:
|
||||
|
||||
```js
|
||||
import utils from '@react-native-firebase/utils';
|
||||
```
|
||||
|
||||
The package also provides access to the firebase instance:
|
||||
|
||||
```js
|
||||
import { firebase } from '@react-native-firebase/utils';
|
||||
import { utils } from '@react-native-firebase/app';
|
||||
```
|
||||
|
||||
### Detect whether the app is running within TestL Lab
|
||||
@@ -40,7 +26,7 @@ It is useful to change the apps configuration if it is being run in Test Lab, fo
|
||||
data collection. Such functionality can be carried out by taking advantage of the `isRunningInTestLab` property:
|
||||
|
||||
```js
|
||||
import utils from '@react-native-firebase/utils';
|
||||
import { utils } from '@react-native-firebase/app';
|
||||
import analytics from '@react-native-firebase/analytics';
|
||||
|
||||
async function bootstrap() {
|
||||
@@ -49,3 +35,15 @@ async function bootstrap() {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Access device file paths
|
||||
|
||||
Some modules require access to your local device filesystem (such as Storage & ML Kit Vision). The utils
|
||||
module access to the device directory locations, working cross platform on Android & iOS.
|
||||
|
||||
```js
|
||||
import { utils } from '@react-native-firebase/app';
|
||||
|
||||
// Access the device pictures directory
|
||||
const picturesDir = utils.FilePath.PICTURES_DIRECTORY;
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user