Skip to content

Commit 3ea1738

Browse files
authored
💎 Bump version to 8.6.4
1 parent 345e95f commit 3ea1738

File tree

7 files changed

+39
-42
lines changed

7 files changed

+39
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
## v8.6.4 (2019-09-12)
1+
## v8.6.4 (2019-09-13)
22

3-
**If you are on React Native pre 0.60, please follow the steps [here](https://github.com/Instabug/Instabug-React-Native/blob/master/README.md#updating-to-version-864)**
43
* Fixes an issue on Android that would result in a build error with the message `null is not an object (evaluating u.invocationEventNone)`
5-
* Fixes an issue on Android that would result in some APIs not working when called immediately after `Instabug.start`
64

75
## v8.6.3 (2019-08-29)
86

9-
* **⚠️ If you are using Android, please make sure to follow the migration guide [here](https://github.com/Instabug/Instabug-React-Native/blob/master/README.md#updating-to-version-863)**
10-
* You can now initialize Instabug on Android by calling `Instabug.start` from Javascript, instead of calling the builder method from the application class.
117
* Updates native iOS SDK to v8.6.2
128

139
## v8.6.2 (2019-08-29)

InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public boolean getUseDeveloperSupport() {
2424
protected List<ReactPackage> getPackages() {
2525
@SuppressWarnings("UnnecessaryLocalVariable")
2626
List<ReactPackage> packages = new PackageList(this).getPackages();
27+
new RNInstabugReactnativePackage.Builder("YOUR_TOKEN", MainApplication.this)
28+
.setInvocationEvent("button")
29+
.setPrimaryColor("#1D82DC")
30+
.setFloatingEdge("left")
31+
.setFloatingButtonOffsetFromTop(250)
32+
.build();
2733
// Packages that cannot be autolinked yet can be added manually here, for example:
2834
// packages.add(new MyReactNativePackage());
2935
return packages;

README.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,35 @@ pod install
8787
```
8888

8989
## Using Instabug
90-
1. To start using Instabug, import it into your `index.js` file.
90+
1. To start using Instabug, import it into your `index.ios.js` and `index.android.js` file.
9191

9292
```javascript
9393
import Instabug from 'instabug-reactnative';
9494
```
95-
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.
95+
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).
9696

9797
```javascript
98-
Instabug.start('APP_TOKEN', [Instabug.invocationEvent.shake]);
98+
Instabug.startWithToken('IOS_APP_TOKEN', [Instabug.invocationEvent.shake]);
99+
```
100+
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.
102+
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.
103+
```javascript
104+
@Override
105+
protected List<ReactPackage> getPackages() {
106+
return Arrays.<ReactPackage>asList(
107+
new MainReactPackage(),
108+
new RNInstabugReactnativePackage.Builder("YOUR_APP_TOKEN", MainApplication.this)
109+
.setInvocationEvent("shake")
110+
.setPrimaryColor("#1D82DC")
111+
.setFloatingEdge("left")
112+
.setFloatingButtonOffsetFromTop(250)
113+
.build()
114+
}
99115
```
100116
You can find your app token by selecting the SDK tab from your [**Instabug dashboard**](https://dashboard.instabug.com/app/sdk/).
101117
102-
3. 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.
118+
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.
103119
```dart
104120
allprojects {
105121
repositories {
@@ -150,27 +166,6 @@ npm install instabug-reactnative
150166
react-native add-instabug
151167
```
152168
153-
### Updating to version 8.6.4
154-
155-
Starting the SDK on Android can now be done from the JS side and no longer requires the integration code inside Android's `MainApplication.java`.
156-
157-
1) Remove the android integration code from your `MainApplication.java`, it should look something like this:
158-
159-
```java
160-
new RNInstabugReactnativePackage.Builder("YOUR_APP_TOKEN", MainApplication.this)
161-
.setInvocationEvent("shake")
162-
.build();
163-
```
164-
165-
2. If you are on React Native < 0.60, unlink instabug using `react-native unlink instabug-reactnative` then link again using `react-native link instabug-reactnative`.
166-
167-
3. 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.
168-
169-
```javascript
170-
Instabug.start('APP_TOKEN', [Instabug.invocationEvent.shake]);
171-
```
172-
173-
174169
## Microphone and Photo Library Usage Description (iOS Only)
175170
176171
Instabug needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that don’t provide a usage description for those 2 permissions would be rejected when submitted to the App Store.
@@ -215,4 +210,4 @@ NetworkLogger.setEnabled(false);
215210
216211
## Documentation
217212
218-
For more details about the supported APIs and how to use them, check our [**Documentation**](https://docs.instabug.com/docs/react-native-overview).
213+
For more details about the supported APIs and how to use them, check our [**Documentation**](https://docs.instabug.com/docs/react-native-overview).

__tests__/index.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ describe('Instabug Module', () => {
9595

9696
});
9797

98-
it('should not call the native method startWithToken when platform is android', () => {
98+
// it('should not call the native method startWithToken when platform is android', () => {
9999

100-
Platform.OS = 'android';
101-
const token = 'some-token';
102-
const invocationEvents = [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake];
103-
Instabug.start(token, invocationEvents);
100+
// Platform.OS = 'android';
101+
// const token = 'some-token';
102+
// const invocationEvents = [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake];
103+
// Instabug.start(token, invocationEvents);
104104

105-
expect(startWithToken.calledOnceWithExactly(token, invocationEvents)).toBe(true);
105+
// expect(startWithToken.calledOnceWithExactly(token, invocationEvents)).toBe(true);
106106

107-
});
107+
// });
108108

109109
it('should call the native method setUserData', () => {
110110

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727

2828
dependencies {
2929
implementation 'com.facebook.react:react-native:+'
30-
api('com.instabug.library:instabug:8.6.3.0') {
30+
api('com.instabug.library:instabug:8.6.3.1') {
3131
exclude group: 'com.android.support:appcompat-v7'
3232
}
3333
testImplementation 'org.mockito:mockito-core:1.10.19'

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const InstabugModule = {
5656
* the SDK's UI.
5757
*/
5858
start: function(token, invocationEvent) {
59-
Instabug.startWithToken(token, invocationEvent);
59+
if (Platform.OS === 'ios') Instabug.startWithToken(token, invocationEvent);
6060
},
6161

6262
/**

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.6.3",
3+
"version": "8.6.4",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -28,7 +28,7 @@
2828
"preunlink": "node node_modules/instabug-reactnative/unlink_bridge.js"
2929
},
3030
"android": {
31-
"packageInstance": "\t\tnew RNInstabugReactnativePackage()"
31+
"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()"
3232
}
3333
},
3434
"devDependencies": {

0 commit comments

Comments
 (0)