HomeDocumentationAPI Reference
Getting StartedAPI ReferenceHelp CenterVideo Tours

Set Shaking Threshold

You can use this API to adjust the shaking sensitivity. This will allow the device to show the invocation with weaker or stronger shakes in case the shake invocation method is used. The threshold takes floats on iOS and integers on Android..

BugReporting.shakingThresholdForiPhone = 3.0;
BugReporting.shakingThresholdForiPad = 1.0;
IBGBugReporting.shakingThresholdForiPhone = 3.0;
IBGBugReporting.shakingThresholdForiPad = 1.0;
BugReporting.setShakingThreshold(800);
//iOS
BugReporting.setShakingThresholdForiPhone(iPhoneShakingThreshold);
BugReporting.setShakingThresholdForiPad(iPadShakingThreshold);

//Android
BugReporting.setShakingThresholdForAndroid(androidThreshold);
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       shakingThresholdAndroid:12, //Default value: 11
       shakingThresholdIPhone: 2,  //Default value: 2.5
       shakingThresholdIPad: 0.5   //Default value: 0.6
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Can be changed through this API as well
cordova.plugins.instabug.setShakingThreshold(3.0, () => {}, (error) => {})
//iOS
IBGBugReporting.ShakingThresholdForiPhone = 3.0;
IBGBugReporting.ShakingThresholdForiPad = 1.0;

//Android
BugReporting.SetShakingThreshold(5);
// iOS
BugReporting.setShakingThresholdForiPhone(3.0);
BugReporting.setShakingThresholdForiPad(1.0);
// Android
BugReporting.setShakingThresholdForAndroid(800);