@@ -48,20 +48,6 @@ module.exports = {
48
48
Instabug . dismiss ( ) ;
49
49
} ,
50
50
51
- /**
52
- * Attaches a file to each report being sent.
53
- * A new copy of the file at fileLocation will be attached with each bug
54
- * report being sent.
55
- * Each call to this method overrides the file to be attached.
56
- * The file has to be available locally at the provided path.
57
- * @param {string } fileLocation Path to a file that's going to be attached
58
- * to each report.
59
- */
60
- // Not yet tested
61
- setFileAttachment : function ( fileLocation ) {
62
- Instabug . setFileAttachment ( fileLocation ) ;
63
- } ,
64
-
65
51
/**
66
52
* Attaches user data to each report being sent.
67
53
* Each call to this method overrides the user data to be attached.
@@ -98,7 +84,7 @@ module.exports = {
98
84
* Sets a block of code to be executed before sending each report.
99
85
* This block is executed in the background before sending each report. Could
100
86
* be used for attaching logs and extra data to reports.
101
- * @param {preSendingHandler } preSendingHandler - A callback that gets executed before sending each bug
87
+ * @param {function } preSendingHandler - A callback that gets executed before sending each bug
102
88
* report.
103
89
*/
104
90
setPreSendingHandler : function ( preSendingHandler ) {
@@ -119,7 +105,7 @@ module.exports = {
119
105
* Sets a block of code to be executed just before the SDK's UI is presented.
120
106
* This block is executed on the UI thread. Could be used for performing any
121
107
* UI changes before the SDK's UI is shown.
122
- * @param {preInvocationHandler } preInvocationHandler - A callback that gets executed before invoking the SDK
108
+ * @param {function } preInvocationHandler - A callback that gets executed before invoking the SDK
123
109
*/
124
110
setPreInvocationHandler : function ( preInvocationHandler ) {
125
111
if ( Platform . OS === 'ios' ) {
@@ -138,7 +124,7 @@ module.exports = {
138
124
* Sets a block of code to be executed right after the SDK's UI is dismissed.
139
125
* This block is executed on the UI thread. Could be used for performing any
140
126
* UI changes after the SDK's UI is dismissed.
141
- * @param {postInvocationHandler } postInvocationHandler - A callback to get executed after
127
+ * @param {function } postInvocationHandler - A callback to get executed after
142
128
* dismissing the SDK.
143
129
*/
144
130
setPostInvocationHandler : function ( postInvocationHandler ) {
@@ -390,15 +376,15 @@ module.exports = {
390
376
391
377
/**
392
378
* Sets a block of code that gets executed when a new message is received.
393
- * @param {onNewMessgaeHandler } onNewMessageHandler - A callback that gets
379
+ * @param {function } onNewMessageHandler - A callback that gets
394
380
* executed when a new message is received.
395
381
*/
396
382
setOnNewMessageHandler : function ( onNewMessageHandler ) {
397
383
if ( Platform . OS === 'ios' ) {
398
384
Instabug . addListener ( 'IBGonNewMessageHandler' ) ;
399
385
NativeAppEventEmitter . addListener (
400
386
'IBGonNewMessageHandler' ,
401
- onNewMessgaeHandler
387
+ onNewMessageHandler
402
388
) ;
403
389
}
404
390
@@ -413,7 +399,7 @@ module.exports = {
413
399
* you should call didReceiveRemoteNotification: to let the Instabug handle
414
400
* the notification. Otherwise, handle the notification on your own.
415
401
* @param {Object } dict Notification's userInfo
416
- * @param {isInstabugNotificationCallback } isInstabugNotificationCallback callback with
402
+ * @param {function } isInstabugNotificationCallback callback with
417
403
* argument isInstabugNotification
418
404
*/
419
405
isInstabugNotification : function ( dict , isInstabugNotificationCallback ) {
@@ -449,7 +435,7 @@ module.exports = {
449
435
* feedback.
450
436
* Use this method to give users a list of choices of categories their bug report or feedback might be related
451
437
* to. Selected category will be shown as a tag on your dashboard.
452
- * @param {array } titles titles to be shown in the list.
438
+ * @param {Array } titles titles to be shown in the list.
453
439
*/
454
440
setReportCategories : function ( ...titles ) {
455
441
if ( Platform . OS == 'ios' ) {
@@ -604,7 +590,7 @@ module.exports = {
604
590
* Returns the user attribute associated with a given key.
605
591
aKey
606
592
* @param {string } key The attribute key as string
607
- * @param {userAttributeCallback } userAttributeCallback callback with argument as the desired user attribute value
593
+ * @param {function } userAttributeCallback callback with argument as the desired user attribute value
608
594
*/
609
595
getUserAttribute : function ( key , userAttributeCallback ) {
610
596
Instabug . getUserAttribute ( key , userAttributeCallback ) ;
@@ -624,7 +610,7 @@ module.exports = {
624
610
625
611
/**
626
612
* @summary Returns all user attributes.
627
- * @param {userAttributesCallback } userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
613
+ * @param {function } userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
628
614
* or an empty dictionary if no user attributes have been set.
629
615
*/
630
616
getAllUserAttributes : function ( userAttributesCallback ) {
@@ -638,18 +624,43 @@ module.exports = {
638
624
Instabug . clearAllUserAttributes ( ) ;
639
625
} ,
640
626
641
- setViewHirearchyEnabled : function ( viewHirearchyEnabled ) {
642
- Instabug . setViewHirearchyEnabled ( viewHirearchyEnabled ) ;
627
+ /**
628
+ * @summary Enables/disables inspect view hierarchy when reporting a bug/feedback.
629
+ * @param {boolean } viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
630
+ */
631
+ setViewHierarchyEnabled : function ( viewHierarchyEnabled ) {
632
+ if ( Platform . OS === 'ios' ) {
633
+ Instabug . setViewHierarchyEnabled ( viewHierarchyEnabled ) ;
634
+ }
643
635
} ,
644
636
637
+ /**
638
+ * @summary Sets whether surveys are enabled or not.
639
+ * If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
640
+ * those surveys are still going to be sent to the device, but are not going to be shown automatically.
641
+ * To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
642
+ * Defaults to `true`.
643
+ * @param {boolean } surveysEnabled A boolean to set whether Instabug Surveys is enabled or disabled.
644
+ */
645
645
setSurveysEnabled : function ( surveysEnabled ) {
646
646
Instabug . setSurveysEnabled ( surveysEnabled )
647
647
} ,
648
648
649
+ /**
650
+ * @summary Shows one of the surveys that were not shown before, that also have conditions that match the current device/user.
651
+ * Does nothing if there are no available surveys or if a survey has already been shown in the current session.
652
+ */
649
653
showSurveysIfAvailable : function ( ) {
650
654
Instabug . showSurveysIfAvailable ( )
651
655
} ,
652
656
657
+ /**
658
+ * @summary Sets a block of code to be executed just before the survey's UI is presented.
659
+ * This block is executed on the UI thread. Could be used for performing any UI changes before
660
+ * the survey's UI is shown.
661
+ * @param {function } willShowSurveyHandler - A block of code that gets executed before presenting the survey's UI.
662
+ * report.
663
+ */
653
664
setWillShowSurveyHandler : function ( willShowSurveyHandler ) {
654
665
if ( Platform . OS === 'ios' ) {
655
666
Instabug . addListener ( 'IBGWillShowSurvey' ) ;
@@ -663,6 +674,12 @@ module.exports = {
663
674
664
675
} ,
665
676
677
+ /**
678
+ * @summary Sets a block of code to be executed right after the survey's UI is dismissed.
679
+ * This block is executed on the UI thread. Could be used for performing any UI changes after the survey's UI
680
+ * is dismissed.
681
+ * @param {function } didDismissSurveyHandler - A block of code that gets executed after the survey's UI is dismissed.
682
+ */
666
683
setDidDismissSurveyHandler : function ( didDismissSurveyHandler ) {
667
684
if ( Platform . OS === 'ios' ) {
668
685
Instabug . addListener ( 'IBGDidDismissSurvey' ) ;
@@ -691,14 +708,6 @@ module.exports = {
691
708
Instabug . setPromptOptionsEnabled ( chat , bug , feedback ) ;
692
709
} ,
693
710
694
- /**
695
- * Clears all Uris of the attached files.
696
- * The URIs which added via {@link Instabug#addFileAttachment} API not the physical files.
697
- */
698
- clearFileAttachment : function ( ) {
699
- Instabug . clearFileAttachment ( ) ;
700
- } ,
701
-
702
711
/**
703
712
* The event used to invoke the feedback form
704
713
* @readonly
0 commit comments