From c0c09bfc9587546f1bf2e6a477495d35def14cc8 Mon Sep 17 00:00:00 2001 From: DevHossamHassan Date: Mon, 26 Jun 2017 23:19:46 +0200 Subject: [PATCH 1/2] Expose setShakeThresholdForAndroid API to JS --- .../RNInstabugReactnativeModule.java | 16 ++++++++++++++++ index.js | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 3744d0e65..c92b1e0b8 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -1058,6 +1058,22 @@ public void clearFileAttachment() { } } + /** + * Sets the threshold value of the shake gesture for android devices. + * Default for android is an integer value equals 350. + * you could increase the shaking difficulty level by + * increasing the `350` value and vice versa. + * + * @param {number} androidThreshold Threshold for android devices. + */ + @ReactMethod + public void setShakingThresholdForAndroid(androidThreshold) { + try { + mInstabug.setShakingThreshold(androidThreshold); + } catch (Exception e) { + e.printStackTrace(); + } + } /** * Sets a block of code that gets executed when a new message is received. diff --git a/index.js b/index.js index 332364d87..bb7cf2faa 100644 --- a/index.js +++ b/index.js @@ -246,6 +246,18 @@ module.exports = { Instabug.setShakingThresholdForIPhone(iPhoneShakingThreshold, iPadShakingThreshold); }, + /** + * Sets the threshold value of the shake gesture for android devices. + * Default for android is an integer value equals 350. + * you could increase the shaking difficulty level by + * increasing the `350` value and vice versa + * @param {number} androidThreshold Threshold for android devices. + */ + setShakingThresholdForAndroid: function (androidThreshold) { + if (Platform.OS === 'android') + Instabug.setShakingThresholdForAndroid(androidThreshold); + }, + /** * Sets the default edge and offset from the top at which the floating button * will be shown. Different orientations are already handled. From f4d19582a516f5be0929f2f34c88e928c1e8fbda Mon Sep 17 00:00:00 2001 From: DevHossamHassan Date: Mon, 26 Jun 2017 23:38:16 +0200 Subject: [PATCH 2/2] Pump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8f216bf8..e9ff80fc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instabug-reactnative", - "version": "1.1.1", + "version": "1.1.2", "description": "React Native plugin for integrating the Instabug SDK", "main": "index.js", "repository": {