You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,130 +20,155 @@ Updating to a new version? Check the [Update Guide](#update-guide) before bumpin
20
20
21
21
1. In Terminal, navigate to your React Native directory and install the `instabug-reactnative` package:
22
22
23
-
```bash
24
-
npm install instabug-reactnative
25
-
```
26
-
27
-
Or if you prefer to use Yarn instead of npm:
23
+
```bash
24
+
npm install instabug-reactnative
25
+
```
28
26
29
-
```bash
30
-
yarn add instabug-reactnative
31
-
```
27
+
Or if you prefer to use Yarn instead of npm:
28
+
29
+
```bash
30
+
yarn add instabug-reactnative
31
+
```
32
32
33
33
2. For projects that build for iOS, install `xcodeproj` gem:
34
+
35
+
```bash
36
+
gem install xcodeproj
37
+
```
34
38
35
-
```bash
36
-
gem install xcodeproj
37
-
```
39
+
3. If you are using React Native < 0.60 link the bridging files in the `instabug-reactnative` package:
38
40
39
-
3. Finally, link the bridging files in the `instabug-reactnative` package:
41
+
```bash
42
+
react-native link instabug-reactnative
43
+
```
40
44
45
+
If you are on React Native > 0.60, then simply run the command:
41
46
42
-
```bash
43
-
react-native link instabug-reactnative
44
-
```
47
+
```bash
48
+
react-native add-instabug
49
+
```
45
50
46
51
### Using CocoaPods (iOS only)
47
52
48
53
Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for managing dependencies.
49
54
50
55
1. In Terminal, navigate to your React Native directory and install the `instabug-reactnative` package:
51
56
52
-
```bash
53
-
npm install instabug-reactnative
54
-
```
57
+
```bash
58
+
npm install instabug-reactnative
59
+
```
55
60
56
61
2. Add the following to your `Podfile`:
57
62
58
-
```ruby
59
-
pod 'instabug-reactnative', :path => '../node_modules/instabug-reactnative'
60
-
pod 'React', :path => '../node_modules/react-native', :subspecs => [
61
-
'Core',
62
-
'CxxBridge',
63
-
'DevSupport'
64
-
]
65
-
66
-
# Required React native dependencies
67
-
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
68
-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
69
-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
70
-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
71
-
72
-
# To make sure that archiving works correctly in Xcode, React has to be
73
-
# removed from the Pods project as it's already included in the main project.
74
-
post_install do |installer|
75
-
installer.pods_project.targets.each do |target|
76
-
if target.name =="React"
77
-
target.remove_from_project
78
-
end
79
-
end
80
-
end
81
-
```
63
+
```ruby
64
+
pod 'instabug-reactnative', :path =>'../node_modules/instabug-reactnative'
65
+
pod 'React', :path =>'../node_modules/react-native', :subspecs => [
66
+
'Core',
67
+
'CxxBridge',
68
+
'DevSupport'
69
+
]
70
+
71
+
# Required React native dependencies
72
+
pod 'yoga', :path =>'../node_modules/react-native/ReactCommon/yoga'
73
+
pod 'DoubleConversion', :podspec =>'../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
74
+
pod 'glog', :podspec =>'../node_modules/react-native/third-party-podspecs/GLog.podspec'
75
+
pod 'Folly', :podspec =>'../node_modules/react-native/third-party-podspecs/Folly.podspec'
76
+
77
+
# To make sure that archiving works correctly in Xcode, React has to be
78
+
# removed from the Pods project as it's already included in the main project.
79
+
post_install do|installer|
80
+
installer.pods_project.targets.each do|target|
81
+
if target.name == "React"
82
+
target.remove_from_project
83
+
end
84
+
end
85
+
end
86
+
```
82
87
83
88
3. Install `instabug-reactnative`:
84
89
85
-
```bash
86
-
pod install
87
-
```
90
+
```bash
91
+
pod install
92
+
```
88
93
89
94
## Using Instabug
90
95
1. To start using Instabug, import it into your `index.ios.js` and `index.android.js` file.
91
96
92
-
```javascript
93
-
importInstabugfrom'instabug-reactnative';
94
-
```
97
+
```javascript
98
+
import Instabug from 'instabug-reactnative';
99
+
```
95
100
2. Then initialize it in the `constructor` or `componentWillMount`. This line will let the Instabug SDK work with the default behavior. The SDK will be invoked when the device is shaken. You can customize this behavior through the APIs (You can skip this step if you are building an Android app only).
3. Open `android/app/src/main/java/[...]/MainApplication.java`
101
-
You should find the getPackages method looks like the following snippet. You just need to add your Android app token (You can skip this step if you are building an iOS app only). 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.
3. Open `android/app/src/main/java/[...]/MainApplication.java` (You can skip this step if you are building an iOS app only)
106
+
* React Native < 0.60
107
+
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.
102
108
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.
You can find your app token by selecting the SDK tab from your [**Instabug dashboard**](https://dashboard.instabug.com/app/sdk/).
117
142
118
143
4. Make sure the following snippet is added to your project level `build.gradle`. This should be added automatically upon linking. If not, you can add it manually.
0 commit comments