Update utils docs

This commit is contained in:
ehesp
2019-08-21 10:42:47 +01:00
parent 6d81cf8129
commit 355bfe4746
5 changed files with 18 additions and 46 deletions

View File

@@ -257,7 +257,3 @@
to: '/'
- text: Quick Start
to: '/quick-start'
- text: Android Setup
to: '/android'
- text: iOS Setup
to: '/ios'

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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;
```