Skip to content

Commit 308aaa9

Browse files
author
Ali Abdelfattah
authored
Format README.md
Reorder installation steps in favor of users using the latest version of RN.
1 parent 11739a8 commit 308aaa9

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ Updating to a new version? Check the [Update Guide](#update-guide) before bumpin
3636
gem install xcodeproj
3737
```
3838

39-
3. If you are using React Native < 0.60 link the bridging files in the `instabug-reactnative` package:
39+
3. **For React Native >= 0.60**, simply run the command:
4040

4141
```bash
42-
react-native link instabug-reactnative
42+
react-native add-instabug
4343
```
44-
45-
If you are on React Native > 0.60, then simply run the command:
44+
45+
**For React Native < 0.60**, link the bridging files in the `instabug-reactnative` package:
4646

4747
```bash
48-
react-native add-instabug
48+
react-native link instabug-reactnative
4949
```
5050

5151
### Using CocoaPods (iOS only)
@@ -105,24 +105,7 @@ Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for manag
105105
3. Open `android/app/src/main/java/[...]/MainApplication.java` (You can skip this step if you are building an iOS app only)
106106
* Make sure to import the package class:
107107
`import com.instabug.reactlibrary.RNInstabugReactnativePackage;`
108-
* React Native < 0.60
109-
You should find the `getPackages()` method looks like the following snippet. You just need to add your Android app token. You can change the invocation event from here, simply by replacing the `"shake"` with any of the following `"button"`, `"none"`, `"screenshot"`, or `"swipe"`. You can change the primary color by replacing the `"#1D82DC"` with any colour of your choice.
110-
In the case that you are using the floating button as an invocation event, you can change the floating button edge and the floating button offset using the last two methods, by replacing `"left"` to `"right"`, and by changing the offset number.
111-
112-
```javascript
113-
@Override
114-
protected List<ReactPackage> getPackages() {
115-
return Arrays.<ReactPackage>asList(
116-
new MainReactPackage(),
117-
new RNInstabugReactnativePackage.Builder("YOUR_APP_TOKEN", MainApplication.this)
118-
.setInvocationEvent("shake")
119-
.setPrimaryColor("#1D82DC")
120-
.setFloatingEdge("left")
121-
.setFloatingButtonOffsetFromTop(250)
122-
.build()
123-
}
124-
```
125-
* React Native > 0.60
108+
* **For React Native >= 0.60**
126109
Add the above integration code to the `onCreate()` method instead:
127110
128111
```java
@@ -139,6 +122,23 @@ Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for manag
139122
SoLoader.init(this, /* native exopackage */ false);
140123
}
141124
```
125+
* **For React Native < 0.60**
126+
You should find the `getPackages()` method looks like the following snippet. You just need to add your Android app token. You can change the invocation event from here, simply by replacing the `"shake"` with any of the following `"button"`, `"none"`, `"screenshot"`, or `"swipe"`. You can change the primary color by replacing the `"#1D82DC"` with any colour of your choice.
127+
In the case that you are using the floating button as an invocation event, you can change the floating button edge and the floating button offset using the last two methods, by replacing `"left"` to `"right"`, and by changing the offset number.
128+
129+
```javascript
130+
@Override
131+
protected List<ReactPackage> getPackages() {
132+
return Arrays.<ReactPackage>asList(
133+
new MainReactPackage(),
134+
new RNInstabugReactnativePackage.Builder("YOUR_APP_TOKEN", MainApplication.this)
135+
.setInvocationEvent("shake")
136+
.setPrimaryColor("#1D82DC")
137+
.setFloatingEdge("left")
138+
.setFloatingButtonOffsetFromTop(250)
139+
.build()
140+
}
141+
```
142142
143143
You can find your app token by selecting the SDK tab from your [**Instabug dashboard**](https://dashboard.instabug.com/app/sdk/).
144144

0 commit comments

Comments
 (0)