Skip to content

Commit ba85a8b

Browse files
Merge pull request #43 from Instabug/dev
Dev
2 parents e2fcdcc + f4d1958 commit ba85a8b

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,22 @@ public void clearFileAttachment() {
10581058
}
10591059
}
10601060

1061+
/**
1062+
* Sets the threshold value of the shake gesture for android devices.
1063+
* Default for android is an integer value equals 350.
1064+
* you could increase the shaking difficulty level by
1065+
* increasing the `350` value and vice versa.
1066+
*
1067+
* @param {number} androidThreshold Threshold for android devices.
1068+
*/
1069+
@ReactMethod
1070+
public void setShakingThresholdForAndroid(androidThreshold) {
1071+
try {
1072+
mInstabug.setShakingThreshold(androidThreshold);
1073+
} catch (Exception e) {
1074+
e.printStackTrace();
1075+
}
1076+
}
10611077

10621078
/**
10631079
* Sets a block of code that gets executed when a new message is received.

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ module.exports = {
246246
Instabug.setShakingThresholdForIPhone(iPhoneShakingThreshold, iPadShakingThreshold);
247247
},
248248

249+
/**
250+
* Sets the threshold value of the shake gesture for android devices.
251+
* Default for android is an integer value equals 350.
252+
* you could increase the shaking difficulty level by
253+
* increasing the `350` value and vice versa
254+
* @param {number} androidThreshold Threshold for android devices.
255+
*/
256+
setShakingThresholdForAndroid: function (androidThreshold) {
257+
if (Platform.OS === 'android')
258+
Instabug.setShakingThresholdForAndroid(androidThreshold);
259+
},
260+
249261
/**
250262
* Sets the default edge and offset from the top at which the floating button
251263
* will be shown. Different orientations are already handled.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-reactnative",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)