@@ -78,11 +78,10 @@ - (dispatch_queue_t)methodQueue {
78
78
}
79
79
80
80
RCT_EXPORT_METHOD (invoke) {
81
- [[NSRunLoop mainRunLoop ] performBlock: ^{
82
- [IBGBugReporting invoke ];
83
- }];
81
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (invoke ) target: [IBGBugReporting class ] argument: nil order: 0 modes: @[NSDefaultRunLoopMode ]];
84
82
}
85
83
84
+
86
85
RCT_EXPORT_METHOD (invokeWithInvocationModeAndOptions:(IBGInvocationMode)invocationMode options:(NSArray *)options) {
87
86
[[NSRunLoop mainRunLoop ] performBlock: ^{
88
87
IBGBugReportingInvocationOption invocationOptions = 0 ;
@@ -360,15 +359,11 @@ - (dispatch_queue_t)methodQueue {
360
359
}
361
360
362
361
RCT_EXPORT_METHOD (setColorTheme:(IBGColorTheme)colorTheme) {
363
- [[NSRunLoop mainRunLoop ] performBlock: ^{
364
362
[Instabug setColorTheme: colorTheme];
365
- }];
366
363
}
367
364
368
365
RCT_EXPORT_METHOD (setPrimaryColor:(UIColor *)color) {
369
- [[NSRunLoop mainRunLoop ] performBlock: ^{
370
366
Instabug.tintColor = color;
371
- }];
372
367
}
373
368
374
369
RCT_EXPORT_METHOD (appendTags:(NSArray *)tags) {
@@ -571,9 +566,8 @@ - (dispatch_queue_t)methodQueue {
571
566
}
572
567
573
568
RCT_EXPORT_METHOD (showFeatureRequests) {
574
- [[NSRunLoop mainRunLoop ] performBlock: ^{
575
- [IBGFeatureRequests show ];
576
- }];
569
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (show ) target: [IBGFeatureRequests class ] argument: nil order: 0 modes: @[NSDefaultRunLoopMode ]];
570
+
577
571
}
578
572
579
573
RCT_EXPORT_METHOD (setShouldShowSurveysWelcomeScreen:(BOOL )shouldShowWelcomeScreen) {
@@ -673,11 +667,11 @@ - (dispatch_queue_t)methodQueue {
673
667
}
674
668
675
669
RCT_EXPORT_METHOD (show) {
676
- [[NSRunLoop mainRunLoop ] performBlock: ^{
677
- [Instabug show ];
678
- }];
670
+
671
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (show ) target: [Instabug class ] argument: nil order: 0 modes: @[NSDefaultRunLoopMode ]];
679
672
}
680
673
674
+
681
675
RCT_EXPORT_METHOD (setReportTypes:(NSArray *) types ) {
682
676
IBGBugReportingReportType reportTypes = 0 ;
683
677
for (NSNumber *boxedValue in types) {
@@ -691,23 +685,26 @@ - (dispatch_queue_t)methodQueue {
691
685
}
692
686
693
687
RCT_EXPORT_METHOD (showBugReportingWithReportTypeAndOptions:(IBGBugReportingReportType)type options:(NSArray *) options) {
694
- [[NSRunLoop mainRunLoop ] performBlock: ^{
695
688
IBGBugReportingOption parsedOptions = 0 ;
696
689
for (NSNumber *boxedValue in options) {
697
690
parsedOptions |= [boxedValue intValue ];
698
691
}
699
- [IBGBugReporting showWithReportType: type options: parsedOptions];
700
- }];
692
+ NSArray * args = @[@(type), @(parsedOptions)];
693
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (showBugReportingWithReportTypeAndOptionsHelper: ) target: self argument: args order: 0 modes: @[NSDefaultRunLoopMode ]];
694
+ }
695
+
696
+ - (void ) showBugReportingWithReportTypeAndOptionsHelper : (NSArray *)args {
697
+ IBGBugReportingReportType parsedreportType = [args[0 ] intValue ];
698
+ IBGBugReportingOption parsedOptions = [args[1 ] intValue ];
699
+ [IBGBugReporting showWithReportType: parsedreportType options: parsedOptions];
701
700
}
702
701
703
702
RCT_EXPORT_METHOD (setChatsEnabled:(BOOL )isEnabled) {
704
703
IBGChats.enabled = isEnabled;
705
704
}
706
705
707
706
RCT_EXPORT_METHOD (showChats) {
708
- [[NSRunLoop mainRunLoop ] performBlock: ^{
709
- [IBGChats show ];
710
- }];
707
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (show ) target: [IBGChats class ] argument: nil order: 0 modes: @[NSDefaultRunLoopMode ]];
711
708
}
712
709
713
710
RCT_EXPORT_METHOD (setRepliesEnabled:(BOOL ) isEnabled) {
@@ -721,9 +718,7 @@ - (dispatch_queue_t)methodQueue {
721
718
}
722
719
723
720
RCT_EXPORT_METHOD (showReplies) {
724
- [[NSRunLoop mainRunLoop ] performBlock: ^{
725
- [IBGReplies show ];
726
- }];
721
+ [[NSRunLoop mainRunLoop ] performSelector: @selector (show ) target: [IBGReplies class ] argument: nil order: 0 modes: @[NSDefaultRunLoopMode ]];
727
722
}
728
723
729
724
RCT_EXPORT_METHOD (setOnNewReplyReceivedCallback:(RCTResponseSenderBlock) callback) {
0 commit comments