Skip to content

Commit 0b377a2

Browse files
authored
🤝 Merge pull request #36 from Instabug/release/8.0.24
Release/8.0.24
2 parents 9418704 + 81cdb73 commit 0b377a2

File tree

7 files changed

+64
-29
lines changed

7 files changed

+64
-29
lines changed

.github/issue_template.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ your issue will help us a lot.
1313
### Actual Behavior
1414

1515
### Instabug integration code
16-
*Make sure to remove your app token.*
16+
<!--Make sure to remove your app token.-->
1717

1818
### SDK Version
19+
<!--Which version of Instabug React Native are you on?.-->
1920

2021
### React Native, iOS and Android Versions
2122

2223
### Device Model
24+
<!--If this issue is happening on specific devices, please mention them.-->
2325

2426
### [Optional] Project That Reproduces the Issue
27+
<!--While not required, providing a sample project that reproduces the issue you're having will help us solve it much faster.-->

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,61 @@ For more info, visit [Instabug.com](https://www.instabug.com).
1717

1818
## Installation
1919

20-
1. Open the terminal and navigate to your React Native Directory. Then run the following command.
20+
### Using react-native CLI
21+
22+
1. In Terminal, navigate to your React Native directory and install the `instabug-reactnative` package:
2123

2224
```bash
2325
npm install instabug-reactnative
2426
```
25-
or
27+
28+
Or if you prefer to use Yarn instead of npm:
2629

2730
```bash
2831
yarn add instabug-reactnative
2932
```
3033

31-
2. Install [**Ruby**](https://www.ruby-lang.org/en/documentation/installation/). (You can skip this step if you're building for Android only)
34+
2. For projects that build for iOS, install `xcodeproj` gem:
3235

33-
3. Install `xcodeproj` gem by running the following command. (You can also skip this step if you're building for Android only)
3436
```bash
3537
gem install xcodeproj
3638
```
3739

38-
4. Link the bridging files in the npm package to the ios project use the following command.
40+
3. Finally, link the bridging files in the `instabug-reactnative` package:
41+
42+
3943
```bash
4044
react-native link instabug-reactnative
4145
```
42-
### Installing using Cocoapods
43-
Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for managing dependencies. After following the first step from the installation steps above, add the following to your `Podfile`:
46+
47+
### Using CocoaPods (iOS only)
48+
49+
Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for managing dependencies.
50+
51+
1. In Terminal, navigate to your React Native directory and install the `instabug-reactnative` package:
52+
53+
```bash
54+
npm install instabug-reactnative
55+
```
56+
57+
2. Add the following to your `Podfile`:
4458

4559
```ruby
4660
pod 'instabug-reactnative', :path => '../node_modules/instabug-reactnative'
4761
pod 'React', :path => '../node_modules/react-native', :subspecs => [
48-
'Core',
49-
'CxxBridge',
50-
'DevSupport'
62+
'Core',
63+
'CxxBridge',
64+
'DevSupport'
5165
]
66+
67+
# Required React native dependencies
5268
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
5369
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
5470
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
5571
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
56-
```
57-
And add the following post install script at the end of your `Podfile`:
5872

59-
```ruby
73+
# To make sure that archiving works correctly in Xcode, React has to be
74+
# removed from the Pods project as it's already included in the main project.
6075
post_install do |installer|
6176
installer.pods_project.targets.each do |target|
6277
if target.name == "React"
@@ -66,6 +81,12 @@ post_install do |installer|
6681
end
6782
```
6883

84+
3. Install `instabug-reactnative`:
85+
86+
```bash
87+
pod install
88+
```
89+
6990
## Using Instabug
7091
1. To start using Instabug, import it into your `index.ios.js` and `index.android.js` file.
7192

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ android {
2424
}
2525

2626
dependencies {
27-
implementation 'com.facebook.react:react-native:0.20.+'
27+
implementation 'com.facebook.react:react-native:0.58.+'
2828
implementation ('com.instabug.library:instabug:8.0.16'){
2929
exclude group: 'com.android.support:appcompat-v7'
3030
}

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,12 +806,17 @@ public void getUnreadMessagesCount(Callback messageCountCallback) {
806806
* @see InstabugInvocationEvent
807807
*/
808808
@ReactMethod
809-
public void setInvocationEvent(String invocationEventValue) {
810-
try {
811-
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
812-
} catch (Exception e) {
813-
e.printStackTrace();
814-
}
809+
public void setInvocationEvent(final String invocationEventValue) {
810+
new Handler(Looper.getMainLooper()).post(new Runnable() {
811+
@Override
812+
public void run() {
813+
try {
814+
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
815+
} catch (Exception e) {
816+
e.printStackTrace();
817+
}
818+
}
819+
});
815820
}
816821

817822
/**

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativePackage.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class RNInstabugReactnativePackage implements ReactPackage {
2626

2727
private static final String TAG = RNInstabugReactnativePackage.class.getSimpleName();
28-
28+
2929
private Application androidApplication;
3030
private String mAndroidApplicationToken;
3131
private Instabug mInstabug;
@@ -35,7 +35,7 @@ public class RNInstabugReactnativePackage implements ReactPackage {
3535

3636
public RNInstabugReactnativePackage(String androidApplicationToken, Application androidApplication,
3737
String[] invocationEventValues, String primaryColor,
38-
InstabugFloatingButtonEdge floatingButtonEdge, Integer offset) {
38+
InstabugFloatingButtonEdge floatingButtonEdge, Integer offset, boolean crashReportingEnabled) {
3939
this.androidApplication = androidApplication;
4040
this.mAndroidApplicationToken = androidApplicationToken;
4141

@@ -44,7 +44,7 @@ public RNInstabugReactnativePackage(String androidApplicationToken, Application
4444

4545
mInstabug = new Instabug.Builder(this.androidApplication, this.mAndroidApplicationToken)
4646
.setInvocationEvents(this.invocationEvents.toArray(new InstabugInvocationEvent[0]))
47-
.setCrashReportingState(Feature.State.ENABLED)
47+
.setCrashReportingState(crashReportingEnabled ? Feature.State.ENABLED: Feature.State.DISABLED)
4848
.setReproStepsState(State.DISABLED)
4949
.build();
5050

@@ -60,7 +60,7 @@ public RNInstabugReactnativePackage(String androidApplicationToken, Application
6060
public RNInstabugReactnativePackage(String androidApplicationToken, Application androidApplication,
6161
String[] invocationEventValues, String primaryColor) {
6262
new RNInstabugReactnativePackage(androidApplicationToken,androidApplication,invocationEventValues,primaryColor,
63-
InstabugFloatingButtonEdge.LEFT,250);
63+
InstabugFloatingButtonEdge.LEFT,250, true);
6464
}
6565

6666
private void parseInvocationEvent(String[] invocationEventValues) {
@@ -115,6 +115,7 @@ public static class Builder {
115115
String primaryColor;
116116
InstabugFloatingButtonEdge floatingButtonEdge;
117117
int offset;
118+
boolean isCrashReportingEnabled = true;
118119

119120
public Builder(String androidApplicationToken, Application application) {
120121
this.androidApplicationToken = androidApplicationToken;
@@ -126,6 +127,11 @@ public Builder setInvocationEvent(String... invocationEvents) {
126127
return this;
127128
}
128129

130+
public Builder setCrashReportingEnabled(boolean enabled) {
131+
this.isCrashReportingEnabled = enabled;
132+
return this;
133+
}
134+
129135
public Builder setPrimaryColor(String primaryColor) {
130136
this.primaryColor = primaryColor;
131137
return this;
@@ -142,7 +148,7 @@ public Builder setFloatingButtonOffsetFromTop(int offset) {
142148
}
143149

144150
public RNInstabugReactnativePackage build() {
145-
return new RNInstabugReactnativePackage(androidApplicationToken,application,invocationEvents,primaryColor,floatingButtonEdge,offset);
151+
return new RNInstabugReactnativePackage(androidApplicationToken,application,invocationEvents,primaryColor,floatingButtonEdge,offset, isCrashReportingEnabled);
146152
}
147153

148154
private InstabugFloatingButtonEdge getFloatingButtonEdge(String floatingButtonEdgeValue) {

ios/Instabug.framework/InstabugResources.bundle/Instabug_dsym_upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ echo "Instabug: Compressing dSYM file..."
136136
# Upload dSYM
137137
echo "Instabug: Uploading dSYM file..."
138138
ENDPOINT="https://api.instabug.com/api/sdk/v3/symbols_files"
139-
STATUS=$(curl "${ENDPOINT}" --write-out %{http_code} --silent --output /dev/null -F symbols_file=@"${DSYM_PATH_ZIP}" -F application_token="${APP_TOKEN}")
139+
STATUS=$(curl "${ENDPOINT}" --write-out %{http_code} --silent --output /dev/null -F os=ios -F symbols_file=@"${DSYM_PATH_ZIP}" -F application_token="${APP_TOKEN}")
140140
if [ $STATUS -ne 200 ]; then
141141
echo "Instabug: err: dSYM archive not succesfully uploaded."
142142
echo "Instabug: deleting temporary dSYM archive..."

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-reactnative",
3-
"version": "8.0.18",
3+
"version": "8.0.23",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"repository": {
@@ -30,4 +30,4 @@
3030
"packageInstance": "\t\tnew RNInstabugReactnativePackage.Builder(\"YOUR_ANDROID_APPLICATION_TOKEN\",MainApplication.this)\n\t\t\t\t\t\t\t.setInvocationEvent(\"shake\")\n\t\t\t\t\t\t\t.setPrimaryColor(\"#1D82DC\")\n\t\t\t\t\t\t\t.setFloatingEdge(\"left\")\n\t\t\t\t\t\t\t.setFloatingButtonOffsetFromTop(250)\n\t\t\t\t\t\t\t.build()"
3131
}
3232
}
33-
}
33+
}

0 commit comments

Comments
 (0)