-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-readme.hbs
123 lines (84 loc) · 3.07 KB
/
template-readme.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# @janiscommerce/app-crashlytics
![janis-logo](brand-logo.png)
Library of methods to report when the app crashes.
## Firebase setting
Before getting started, you should have set up a [new firebase project](https://console.firebase.google.com/).
If you already have it set up, the next step to do would be to add the google-services.json file to the root directory of your module (/android/app).
### Add the firebase sdk
For the Firebase SDKs to be able to access the google-services.json configuration values, you need the Google Services Gradle plugin.
Add the plugin as a dependency to your project-level build.gradle file: (android/build.gradle)
```javascript
dependencies {
// ...
classpath("com.google.gms:google-services:4.3.15")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")
}
```
You should also add google services plugins in **android/app/build.gradle** and any Firebase SDKs you want to use in your app:
```javascript
plugins {
// ...
// Add the Google services Gradle plugin
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
dependencies {
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:32.2.2')
// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries
}
// Additionally you should make one optional configuration
// It reporting allows you to capture Native Development Kit crashes,
// e.g. in React Native this will capture crashes originating from the Yoga layout engine
android {
// ...
buildTypes {
// ...
release {
// ...
firebaseCrashlytics {
nativeSymbolUploadEnabled true
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
}
}
}
```
You may need to add this in **android/settings.gradle**:
```javascript
// ...
include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android')
```
### Add the firebase file configuration
Add the **firebase.json** file to the root of your project, with:
```javascript
{
"react-native": {
"crashlytics_debug_enabled": true,
}
}
```
### Clean the project
```sh
cd android && ./gradlew clean && cd ..
```
## PeerDependencies Installation
For the methods of this library to work, the following dependencies must be installed:
```sh
npm install @react-native-firebase/app
```
The @react-native-firebase/app module must be installed before using any other Firebase service.
Additionally, you need to install the dependency of the firebase service you want to use.
For example this:
```sh
npm install @react-native-firebase/crashlytics
```
This dependency will allow that, when executing the methods of the package, these can be registered as events in firebase
## Installation
```sh
npm install @janis-commerce/app-crashlytics
```
## Usage
{{>main}}