mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-10 22:48:09 +08:00
Crashlytics doc update
This commit is contained in:
@@ -76,7 +76,52 @@ crashlytics {
|
||||
|
||||
# Android Manual Linking
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
> auto-linking.
|
||||
The following steps are only required if your environment does not have access to React Native auto-linking.
|
||||
|
||||
#### Update Gradle Settings
|
||||
|
||||
Add the following to your projects `/android/settings.gradle` file:
|
||||
|
||||
```groovy
|
||||
include ':@react-native-firebase_crashlytics'
|
||||
project(':@react-native-firebase_crashlytics').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/crashlytics/android')
|
||||
```
|
||||
|
||||
#### Update Gradle Dependencies
|
||||
|
||||
Add the React Native Crashlytics module dependency to your `/android/app/build.gradle` file:
|
||||
|
||||
```groovy{3}
|
||||
dependencies {
|
||||
...
|
||||
implementation project(path: ":@react-native-firebase_crashlytics")
|
||||
}
|
||||
```
|
||||
|
||||
#### Add package to the Android Application
|
||||
|
||||
Import and apply the React Native Firebase module package to your `/android/app/src/main/java/**/MainApplication.java` file:
|
||||
|
||||
Import the package:
|
||||
|
||||
```java
|
||||
import io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsPackage;
|
||||
```
|
||||
|
||||
Add the package to the registry:
|
||||
|
||||
```java{4}
|
||||
protected List<ReactPackage> getPackages() {
|
||||
return Arrays.asList(
|
||||
new MainReactPackage(),
|
||||
new ReactNativeFirebaseCrashlyticsPackage(),
|
||||
```
|
||||
|
||||
#### Rebuild the project
|
||||
|
||||
Once the above steps have been completed, rebuild your Android project:
|
||||
|
||||
```bash
|
||||
npx react-native run-android
|
||||
```
|
||||
|
||||
TODO
|
||||
|
||||
@@ -3,9 +3,65 @@ title: iOS Setup
|
||||
description: Manually integrate Crashlytics into your iOS application.
|
||||
---
|
||||
|
||||
# iOS Manual Linking
|
||||
# iOS Setup
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
> auto-linking.
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add the Crashlytics run script
|
||||
|
||||
Crashlytics for iOS requires an additional manual step once the NPM package has been installed.
|
||||
You'll need XCode for the following steps.
|
||||
|
||||
Open your project in XCode, and select the project file in the Navigator. Select the 'Build Phases' tab &
|
||||
add a 'New Run Script Phase':
|
||||
|
||||

|
||||
|
||||
In the new build phase, add a new script into the text box:
|
||||
|
||||
```
|
||||
"${PODS_ROOT}/Fabric/run"
|
||||
```
|
||||
|
||||

|
||||
|
||||
Once added, rebuild your project:
|
||||
|
||||
```bash
|
||||
npx react-native run-ios
|
||||
```
|
||||
|
||||
## iOS Manual Linking
|
||||
|
||||
The following steps are only required if your environment does not have access to React Native auto-linking.
|
||||
|
||||
## CocoaPods Installation
|
||||
|
||||
### Add the RNFBFirestore Pod
|
||||
|
||||
Add the `RNFBCrashlytics`, `Fabric` & `Crashlytics` Pod to your projects `/ios/Podfile`:
|
||||
|
||||
```ruby{3}
|
||||
target 'app' do
|
||||
...
|
||||
pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics/ios'
|
||||
pod 'Fabric', '~> 1.10.2'
|
||||
pod 'Crashlytics', '~> 3.13.2'
|
||||
end
|
||||
```
|
||||
|
||||
### Update Pods & rebuild the project
|
||||
|
||||
You may need to update your local Pods in order for the Pods to be installed in your project:
|
||||
|
||||
```bash
|
||||
$ cd /ios/
|
||||
$ pod install --repo-update
|
||||
```
|
||||
|
||||
Once the Pods have installed locally, rebuild your iOS project:
|
||||
|
||||
```bash
|
||||
npx react-native run-ios
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
@@ -38,6 +38,27 @@ The package also provides access to the firebase instance:
|
||||
import { firebase } from '@react-native-firebase/crashlytics';
|
||||
```
|
||||
|
||||
Both platforms require additional steps to complete installation:
|
||||
|
||||
<Grid columns="2">
|
||||
<Block
|
||||
title="Android: Additional Steps"
|
||||
to="/android"
|
||||
icon="android"
|
||||
color="#4CAF50"
|
||||
>
|
||||
Follow the Android steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
<Block
|
||||
title="iOS: Additional Steps"
|
||||
to="/ios"
|
||||
icon="phone_iphone"
|
||||
color="#2196F3"
|
||||
>
|
||||
Follow the iOS steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
### Testing crashes
|
||||
|
||||
The Crashlytics package provides a `crash` method which is provided to ensure crash reports are correctly
|
||||
|
||||
@@ -140,11 +140,11 @@
|
||||
to: '/'
|
||||
- text: Quick Start
|
||||
to: '/quick-start'
|
||||
- group: Manual Installation
|
||||
- group: Additional Steps
|
||||
children:
|
||||
- text: Android Installation
|
||||
- text: Android Steps
|
||||
to: '/android'
|
||||
- text: iOS Installation
|
||||
- text: iOS Steps
|
||||
to: '/ios'
|
||||
|
||||
- module: database
|
||||
|
||||
43148
docs/typedoc.json
vendored
43148
docs/typedoc.json
vendored
File diff suppressed because it is too large
Load Diff
2
docs/typedoc.min.json
vendored
2
docs/typedoc.min.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user