Skip to content

Commit 1afae04

Browse files
committed
Update development instructions
1 parent 9f135c9 commit 1afae04

1 file changed

Lines changed: 77 additions & 43 deletions

File tree

DEVELOPMENT.md

Lines changed: 77 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,109 @@
1-
# Setting up the environment
2-
Install Node & Watchman using Homebrew
1+
# Bugfender React Native Development
2+
3+
## Setting up the environment
4+
5+
Please follow the guide located in [React Native Environment Setup](https://reactnative.dev/docs/environment-setup) "React Native CLI Quickstart" tab. The following is an overview of the needed tooling.
6+
7+
Basic tooling:
8+
9+
- NodeJS and [Yarn](https://yarnpkg.com)
10+
- [Watchman](https://github.com/facebook/watchman)
311

412
For Android, install:
5-
- Java Development Kit
6-
- Android Studio with Android SDK
13+
14+
- Java Development Kit
15+
- Android Studio with Android SDK
716

817
For iOS, install:
9-
- XCode with command line tools
10-
- Cocoapods
1118

12-
Please follow the guide on https://reactnative.dev/docs/environment-setup
19+
- XCode with Command Line Tools
20+
- [Cocoapods](https://cocoapods.org)
21+
22+
**Once all the tooling is ready**:
23+
24+
- On the `example` folder:
25+
- `bundle install`: install required Ruby gems
26+
- On the root folder:
27+
- `yarn`: this will install dependencies for the library & `/example`
28+
- Add Bugfender app key in `example` project:
29+
- `cd example/src`
30+
- `cp bugfenderKey.json.example bugfenderKey.json`
31+
- Edit `bugfenderKey.json` & add the key
32+
33+
## Running the example
34+
35+
On a terminal window:
36+
37+
- `cd example`: enter the `example` folder
38+
- `yarn start`: start React Native "server"
39+
- Open a new terminal to run the specific example
40+
41+
For Android:
42+
43+
- Open Android Studio and run an emulator
44+
- `cd example`: enter the `example` folder
45+
- `yarn android`: run in Android
46+
47+
For iOS:
1348

14-
# Running the example
15-
On Android:
16-
- Open Android Studio and run an emulator
17-
- Execute the following command under the example folder: `yarn android`
49+
- `cd example`: enter the `example` folder
50+
- `yarn ios`: run in iOS
1851

19-
On iOS:
20-
- Execute the following command under the example folder: `yarn ios`
52+
For Web:
2153

22-
On Web:
2354
- Please use [this private project](https://bitbucket.org/bugfender/rn-bugfender-development) and execute `yarn web`
2455

25-
## Update React Native version
56+
## Upgrade React Native version
57+
2658
Try with the official react native upgrade command:
59+
2760
```bash
2861
npx react-native upgrade
2962
```
3063

3164
If it does not work you can create a new updated library from scratch:
32-
1. Using [create-react-native-library tool] (https://reactnative.dev/docs/native-modules-setup)
3365

66+
1. Using [create-react-native-library tool](https://reactnative.dev/docs/native-modules-setup)
3467
2. Be sure to select a Native library using Java & Objective-C
35-
3668
3. Add the following lines to the `package.json` of the newly created library (be sure to use the latest version):
37-
```json
38-
"dependencies": {
39-
"@bugfender/common": "1.0.0-alpha.5",
40-
"@bugfender/sdk": "^2.1.0"
41-
}
42-
```
69+
70+
```json
71+
"dependencies": {
72+
"@bugfender/common": "1.0.0-alpha.5",
73+
"@bugfender/sdk": "^2.1.0"
74+
}
75+
```
4376

4477
4. Add "dom" into the "lib" object on `tsconfig.json`:
45-
```json
46-
"lib": [
47-
"esnext",
48-
"dom"
49-
],
50-
```
78+
79+
```json
80+
"lib": [
81+
"esnext",
82+
"dom"
83+
],
84+
```
5185

5286
5. On **android/src/build.gradle** add the following to the dependencies:
53-
```gradle
54-
implementation 'com.bugfender.sdk:android:3.+'
55-
```
5687

57-
6. Copy `RnBugfenderModule.java` and `RnBufgenerPackage.java` to **android/src/main/java/com.bugfender.react**
88+
```gradle
89+
implementation 'com.bugfender.sdk:android:3.+'
90+
```
5891

92+
6. Copy `RnBugfenderModule.java` and `RnBufgenerPackage.java` to **android/src/main/java/com.bugfender.react**.
5993
7. Add the Bugfender dependency to the podspec on the **root** folder
60-
```ruby
61-
s.dependency 'BugfenderSDK', '~> 1.10.5'
62-
```
94+
95+
```ruby
96+
s.dependency 'BugfenderSDK', '~> 1.10.5'
97+
```
6398

6499
8. Copy `RnBugefnder.h` && `RnBugefnder.mm` to **ios/**
100+
9. Copy `App.tsx` & add `bugfenderKey.json` into **example/src/**, see `bugfenderKey.json` format below:
65101

66-
9. Copy `App.tsx` & add `bugfenderKey.json` into **example/src/**, see `bugfenderKey.json` format below:
67-
```json
68-
{
69-
"bugfenderKey": "<your Bugfdender key>"
70-
}
71-
```
102+
```json
103+
{
104+
"bugfenderKey": "<your Bugfdender key>"
105+
}
106+
```
72107

73108
10. Run `pod install` under **example/ios/**
74-
75109
11. You should be ready to run the example using `yarn android` & `yarn ios`

0 commit comments

Comments
 (0)