Skip to content

Commit 42bef2e

Browse files
committed
Add documentation
1 parent b59ae35 commit 42bef2e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,18 +641,41 @@ module.exports = {
641641
Instabug.clearAllUserAttributes();
642642
},
643643

644+
/**
645+
* @summary Enables/disables inspect view hierarchy when reporting a bug/feedback.
646+
* @param {boolean} viewHirearchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
647+
*/
644648
setViewHirearchyEnabled: function (viewHirearchyEnabled) {
645649
Instabug.setViewHirearchyEnabled(viewHirearchyEnabled);
646650
},
647651

652+
/**
653+
* @summary Sets whether surveys are enabled or not.
654+
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
655+
* those surveys are still going to be sent to the device, but are not going to be shown automatically.
656+
* To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
657+
* Defaults to `true`.
658+
* @param {boolean} viewHirearchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
659+
*/
648660
setSurveysEnabled: function (surveysEnabled) {
649661
Instabug.setSurveysEnabled(surveysEnabled)
650662
},
651663

664+
/**
665+
* @summary Shows one of the surveys that were not shown before, that also have conditions that match the current device/user.
666+
* Does nothing if there are no available surveys or if a survey has already been shown in the current session.
667+
*/
652668
showSurveysIfAvailable: function () {
653669
Instabug.showSurveysIfAvailable()
654670
},
655671

672+
/**
673+
* @summary Sets a block of code to be executed just before the survey's UI is presented.
674+
* This block is executed on the UI thread. Could be used for performing any UI changes before
675+
* the survey's UI is shown.
676+
* @param {willShowSurveyHandler} willShowSurveyHandler - A block of code that gets executed before presenting the survey's UI.
677+
* report.
678+
*/
656679
setWillShowSurveyHandler: function (willShowSurveyHandler) {
657680
if (Platform.OS === 'ios') {
658681
Instabug.addListener('IBGWillShowSurvey');
@@ -665,6 +688,12 @@ module.exports = {
665688
}
666689
},
667690

691+
/**
692+
* @summary Sets a block of code to be executed right after the survey's UI is dismissed.
693+
* This block is executed on the UI thread. Could be used for performing any UI changes after the survey's UI
694+
* is dismissed.
695+
* @param {didDismissSurveyHandler} didDismissSurveyHandler - A block of code that gets executed after the survey's UI is dismissed.
696+
*/
668697
setDidDismissSurveyHandler: function (didDismissSurveyHandler) {
669698
if (Platform.OS === 'ios') {
670699
Instabug.addListener('IBGDidDismissSurvey');

0 commit comments

Comments
 (0)