@@ -237,7 +237,11 @@ module.exports = {
237
237
* Notifications count, or -1 incase the SDK has not been initialized.
238
238
*/
239
239
getUnreadMessagesCount : function ( messageCountCallback ) {
240
- Instabug . getUnreadMessagesCount ( messageCountCallback ) ;
240
+ if ( Platform . OS === 'ios' ) {
241
+ Instabug . getUnreadMessagesCount ( messageCountCallback ) ;
242
+ } else if ( Platform . OS === 'android' ) {
243
+ Instabug . getUnreadMessagesCount ( ) ;
244
+ }
241
245
} ,
242
246
243
247
/**
@@ -517,123 +521,123 @@ module.exports = {
517
521
} ,
518
522
519
523
/**
520
- * Add file to attached files with each report being sent.
521
- * A new copy of the file at fileURL will be attached with each bug report being sent. The file is only copied
522
- * at the time of sending the report, so you could safely call this API whenever the file is available on disk, and the copy
523
- * attached to your bug reports will always contain that latest changes at the time of sending the report.
524
- *
525
- * Each call to this method adds the file to the files attached, until a maximum of 3 then it overrides the first file.
526
- * The file has to be available locally at the provided path when the report is being sent.
527
- * @param {string } stringURL Path to a file that's going to be attached to each report.
528
- */
524
+ * Add file to attached files with each report being sent.
525
+ * A new copy of the file at fileURL will be attached with each bug report being sent. The file is only copied
526
+ * at the time of sending the report, so you could safely call this API whenever the file is available on disk, and the copy
527
+ * attached to your bug reports will always contain that latest changes at the time of sending the report.
528
+ *
529
+ * Each call to this method adds the file to the files attached, until a maximum of 3 then it overrides the first file.
530
+ * The file has to be available locally at the provided path when the report is being sent.
531
+ * @param {string } stringURL Path to a file that's going to be attached to each report.
532
+ */
529
533
530
534
// addFileAttachment: function(stringURL) {
531
535
// if (Platform.OS == 'ios') {
532
- // Instabug.addFileAttachment(stringURL);
536
+ // Instabug.addFileAttachment(stringURL);
533
537
// }
534
538
// },
535
539
536
540
/**
537
- * Clear list of files to be attached with each report.
538
- * This method doesn't delete any files from the file system. It will just removes them for the list of files
539
- * to be attached with each report.
540
- */
541
-
541
+ * Clear list of files to be attached with each report.
542
+ * This method doesn't delete any files from the file system. It will just removes them for the list of files
543
+ * to be attached with each report.
544
+ */
545
+
542
546
// clearFileAttachments: function() {
543
547
// if (Platform.OS == 'ios') {
544
- // Instabug.clearFileAttachments();
548
+ // Instabug.clearFileAttachments();
545
549
// }
546
550
// },
547
551
548
552
/**
549
- * Shows/Hides email field.
550
- * Defaults to show email field.
551
- * @param {boolean } shouldShowEmailField true to show the email field, false to hide it.
552
- */
553
- setShowEmailField : function ( shouldShowEmailField ) {
553
+ * Shows/Hides email field.
554
+ * Defaults to show email field.
555
+ * @param {boolean } shouldShowEmailField true to show the email field, false to hide it.
556
+ */
557
+ setShowEmailField : function ( shouldShowEmailField ) {
554
558
if ( Platform . OS == 'ios' ) {
555
- Instabug . setShowEmailField ( ) ;
559
+ Instabug . setShowEmailField ( ) ;
556
560
}
557
561
} ,
558
562
559
563
/**
560
- * Sets the default value of the user's email and hides the email field from the reporting UI
561
- * and set the user's name to be included with all reports.
562
- * It also reset the chats on device to that email and removes user attributes, user data and completed surveys.
563
- * @param {string } email Email address to be set as the user's email.
564
- * @param {string } name Name of the user to be set.
565
- */
566
- identifyUserWithEmail : function ( email , name ) {
564
+ * Sets the default value of the user's email and hides the email field from the reporting UI
565
+ * and set the user's name to be included with all reports.
566
+ * It also reset the chats on device to that email and removes user attributes, user data and completed surveys.
567
+ * @param {string } email Email address to be set as the user's email.
568
+ * @param {string } name Name of the user to be set.
569
+ */
570
+ identifyUserWithEmail : function ( email , name ) {
567
571
if ( Platform . OS == 'ios' ) {
568
- Instabug . identifyUserWithEmail ( email , name ) ;
572
+ Instabug . identifyUserWithEmail ( email , name ) ;
569
573
}
570
574
} ,
571
575
572
576
/**
573
- * Sets the default value of the user's email to nil and show email field and remove user name from all reports
574
- * It also reset the chats on device and removes user attributes, user data and completed surveys.
575
- */
576
- logOut : function ( ) {
577
+ * Sets the default value of the user's email to nil and show email field and remove user name from all reports
578
+ * It also reset the chats on device and removes user attributes, user data and completed surveys.
579
+ */
580
+ logOut : function ( ) {
577
581
if ( Platform . OS == 'ios' ) {
578
- Instabug . logOut ( ) ;
582
+ Instabug . logOut ( ) ;
579
583
}
580
584
} ,
581
585
582
586
/**
583
- * Sets whether to show a "Thank You" dialog after a bug report is sent or not.
584
- * Defaults to YES.
585
- * @param {boolean } isPostSendingDialogEnabled A boolean to indicate whether the dialog is enabled or not.
586
- */
587
- setPostSendingDialogEnabled : function ( isPostSendingDialogEnabled ) {
587
+ * Sets whether to show a "Thank You" dialog after a bug report is sent or not.
588
+ * Defaults to YES.
589
+ * @param {boolean } isPostSendingDialogEnabled A boolean to indicate whether the dialog is enabled or not.
590
+ */
591
+ setPostSendingDialogEnabled : function ( isPostSendingDialogEnabled ) {
588
592
if ( Platform . OS == 'ios' ) {
589
- Instabug . setPostSendingDialogEnabled ( isPostSendingDialogEnabled ) ;
593
+ Instabug . setPostSendingDialogEnabled ( isPostSendingDialogEnabled ) ;
590
594
}
591
595
} ,
592
596
593
597
/**
594
- * Sets an array of report categories to be shown for users to select from before reporting a bug or sending
595
- * feedback.
596
- * Use this method to give users a list of choices of categories their bug report or feedback might be related
597
- * to. Selected category will be shown as a tag on your dashboard.
598
- * @param {array } titles titles to be shown in the list.
599
- * @param {array } name names of icons to be shown along with titles. Use the same names you would use
600
- */
601
- setReportCategories : function ( titles , names ) {
598
+ * Sets an array of report categories to be shown for users to select from before reporting a bug or sending
599
+ * feedback.
600
+ * Use this method to give users a list of choices of categories their bug report or feedback might be related
601
+ * to. Selected category will be shown as a tag on your dashboard.
602
+ * @param {array } titles titles to be shown in the list.
603
+ * @param {array } name names of icons to be shown along with titles. Use the same names you would use
604
+ */
605
+ setReportCategories : function ( titles , names ) {
602
606
if ( Platform . OS == 'ios' ) {
603
- Instabug . setReportCategories ( titles , names ) ;
607
+ Instabug . setReportCategories ( titles , names ) ;
604
608
}
605
609
} ,
606
610
607
611
/**
608
- * Enables/disables inspect view hierarchy when reporting a bug/feedback.
609
- * @param {boolean } viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
610
- */
611
- setViewHierarchyEnabled : function ( viewHierarchyEnabled ) {
612
+ * Enables/disables inspect view hierarchy when reporting a bug/feedback.
613
+ * @param {boolean } viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
614
+ */
615
+ setViewHierarchyEnabled : function ( viewHierarchyEnabled ) {
612
616
if ( Platform . OS == 'ios' ) {
613
- Instabug . setViewHierarchyEnabled ( viewHierarchyEnabled ) ;
617
+ Instabug . setViewHierarchyEnabled ( viewHierarchyEnabled ) ;
614
618
}
615
619
} ,
616
620
617
621
/**
618
- * Logs a user event that happens through the lifecycle of the application.
619
- * Logged user events are going to be sent with each report, as well as at the end of a session.
620
- * @param {string } name Event name.
621
- */
622
- logUserEventWithName : function ( name ) {
622
+ * Logs a user event that happens through the lifecycle of the application.
623
+ * Logged user events are going to be sent with each report, as well as at the end of a session.
624
+ * @param {string } name Event name.
625
+ */
626
+ logUserEventWithName : function ( name ) {
623
627
if ( Platform . OS == 'ios' ) {
624
- Instabug . logUserEventWithName ( name ) ;
628
+ Instabug . logUserEventWithName ( name ) ;
625
629
}
626
630
} ,
627
631
628
632
/**
629
- * Logs a user event that happens through the lifecycle of the application.
630
- * Logged user events are going to be sent with each report, as well as at the end of a session.
631
- * @param {string } name Event name.
632
- * @param {Object } params An optional dictionary or parameters to be associated with the event.
633
- */
634
- logUserEventWithNameAndParams : function ( name , params ) {
633
+ * Logs a user event that happens through the lifecycle of the application.
634
+ * Logged user events are going to be sent with each report, as well as at the end of a session.
635
+ * @param {string } name Event name.
636
+ * @param {Object } params An optional dictionary or parameters to be associated with the event.
637
+ */
638
+ logUserEventWithNameAndParams : function ( name , params ) {
635
639
if ( Platform . OS == 'ios' ) {
636
- Instabug . logUserEventWithNameAndParams ( name , params ) ;
640
+ Instabug . logUserEventWithNameAndParams ( name , params ) ;
637
641
}
638
642
} ,
639
643
@@ -650,7 +654,7 @@ module.exports = {
650
654
*
651
655
* @param message the message
652
656
*/
653
- logVerbose : function ( message ) {
657
+ logVerbose : function ( message ) {
654
658
if ( ! message ) return ;
655
659
if ( Platform . OS === 'android' ) {
656
660
Instabug . log ( "v" , message ) ;
@@ -672,7 +676,7 @@ module.exports = {
672
676
*
673
677
* @param message the message
674
678
*/
675
- logInfo : function ( message ) {
679
+ logInfo : function ( message ) {
676
680
if ( ! message ) return ;
677
681
if ( Platform . OS === 'android' ) {
678
682
Instabug . log ( "i" , message ) ;
@@ -694,7 +698,7 @@ module.exports = {
694
698
*
695
699
* @param message the message
696
700
*/
697
- logDebug : function ( message ) {
701
+ logDebug : function ( message ) {
698
702
if ( ! message ) return ;
699
703
if ( Platform . OS === 'android' ) {
700
704
Instabug . log ( "d" , message ) ;
@@ -716,7 +720,7 @@ module.exports = {
716
720
*
717
721
* @param message the message
718
722
*/
719
- logError : function ( message ) {
723
+ logError : function ( message ) {
720
724
if ( ! message ) return ;
721
725
if ( Platform . OS === 'android' ) {
722
726
Instabug . log ( "e" , message ) ;
@@ -738,7 +742,7 @@ module.exports = {
738
742
*
739
743
* @param message the message
740
744
*/
741
- logWarn : function ( message ) {
745
+ logWarn : function ( message ) {
742
746
if ( ! message ) return ;
743
747
if ( Platform . OS === 'android' ) {
744
748
Instabug . log ( "w" , message ) ;
@@ -771,7 +775,7 @@ module.exports = {
771
775
* Clears Instabug internal log
772
776
*
773
777
*/
774
- clearLogs : function ( ) {
778
+ clearLogs : function ( ) {
775
779
if ( Platform . OS === 'android' ) {
776
780
Instabug . clearLogs ( ) ;
777
781
}
@@ -783,7 +787,7 @@ module.exports = {
783
787
* @param key the attribute
784
788
* @param value the value
785
789
*/
786
- setUserAttribute : function ( key , value ) {
790
+ setUserAttribute : function ( key , value ) {
787
791
if ( ! key || ! value || typeof key !== "string" || typeof value !== "string" )
788
792
throw new TypeError ( "Invalid param, Expected String" ) ;
789
793
if ( Platform . OS === 'android' ) {
@@ -799,11 +803,11 @@ module.exports = {
799
803
800
804
/**
801
805
* Returns the user attribute associated with a given key.
802
- aKey
806
+ aKey
803
807
* @param {string } key The attribute key as string
804
- * @param {userAttributeCallback } userAttributeCallback callback with argument as the desired user attribute value
808
+ * @param {userAttributeCallback } userAttributeCallback callback with argument as the desired user attribute value
805
809
*/
806
- getUserAttribute : function ( key , userAttributeCallback ) {
810
+ getUserAttribute : function ( key , userAttributeCallback ) {
807
811
if ( Platform . OS === 'ios' ) {
808
812
return Instabug . getUserAttribute ( key , userAttributeCallback ) ;
809
813
}
@@ -815,7 +819,7 @@ module.exports = {
815
819
* @param key the attribute key as string
816
820
* @see #setUserAttribute(String, String)
817
821
*/
818
- removeUserAttribute : function ( key ) {
822
+ removeUserAttribute : function ( key ) {
819
823
if ( ! key || typeof key !== "string" )
820
824
throw new TypeError ( "Invalid param, Expected String" ) ;
821
825
if ( Platform . OS === 'android' ) {
@@ -834,7 +838,7 @@ module.exports = {
834
838
* @param {userAttributesCallback } userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
835
839
* or an empty dictionary if no user attributes have been set.
836
840
*/
837
- getAllUserAttributes : function ( userAttributesCallback ) {
841
+ getAllUserAttributes : function ( userAttributesCallback ) {
838
842
if ( Platform . OS === 'ios' ) {
839
843
return Instabug . getAllUserAttributes ( userAttributesCallback ) ;
840
844
}
@@ -843,7 +847,7 @@ module.exports = {
843
847
/**
844
848
* Clears all user attributes if exists.
845
849
*/
846
- clearAllUserAttributes : function ( ) {
850
+ clearAllUserAttributes : function ( ) {
847
851
if ( Platform . OS === 'android' ) {
848
852
Instabug . clearAllUserAttributes ( ) ;
849
853
}
0 commit comments