6
6
7
7
#import " InstabugReactBridge.h"
8
8
#import < Instabug/Instabug.h>
9
+ #import < Instabug/IBGBugReporting.h>
9
10
#import < asl.h>
10
11
#import < React/RCTLog.h>
11
12
#import < os/log.h>
@@ -30,8 +31,12 @@ - (dispatch_queue_t)methodQueue {
30
31
return dispatch_get_main_queue ();
31
32
}
32
33
33
- RCT_EXPORT_METHOD (startWithToken:(NSString *)token invocationEvent:(IBGInvocationEvent)invocationEvent) {
34
- [Instabug startWithToken: token invocationEvent: invocationEvent];
34
+ RCT_EXPORT_METHOD (startWithToken:(NSString *)token invocationEvents:(NSArray *)invocationEventsArray) {
35
+ IBGInvocationEvent invocationEvents = 0 ;
36
+ for (NSNumber *boxedValue in invocationEventsArray) {
37
+ invocationEvents |= [boxedValue intValue ];
38
+ }
39
+ [Instabug startWithToken: token invocationEvents: invocationEvents];
35
40
RCTAddLogFunction (InstabugReactLogFunction);
36
41
RCTSetLogThreshold (RCTLogLevelInfo);
37
42
[Instabug setNetworkLoggingEnabled: NO ];
@@ -42,13 +47,17 @@ - (dispatch_queue_t)methodQueue {
42
47
}
43
48
44
49
RCT_EXPORT_METHOD (invoke) {
45
- [Instabug invoke ];
50
+ [IBGBugReporting invoke ];
46
51
}
47
52
48
53
RCT_EXPORT_METHOD (invokeWithInvocationMode:(IBGInvocationMode)invocationMode) {
49
54
[Instabug invokeWithInvocationMode: invocationMode];
50
55
}
51
56
57
+ RCT_EXPORT_METHOD (invokeWithInvocationModes:(IBGBugReportingInvocationOption)invocationOptions) {
58
+ [Instabug invokeWithOptions: invocationOptions];
59
+ }
60
+
52
61
RCT_EXPORT_METHOD (dismiss) {
53
62
[Instabug dismiss ];
54
63
}
@@ -501,6 +510,15 @@ - (NSDictionary *)constantsToExport
501
510
@" localeSwedish" : @(IBGLocaleSwedish),
502
511
@" localeTurkish" : @(IBGLocaleTurkish),
503
512
513
+ @" invocationOptionNewBug" : @(IBGBugReportingInvocationOptionNewBug),
514
+ @" invocationOptionNewFeedback" : @(IBGBugReportingInvocationOptionNewFeedback),
515
+ @" invocationOptionNewChat" : @(IBGBugReportingInvocationOptionNewChat),
516
+ @" invocationOptionsChatsList" : @(IBGBugReportingInvocationOptionChatsList),
517
+ @" invocationOptionsEmailFieldHidden" : @(IBGBugReportingInvocationOptionEmailFieldHidden),
518
+ @" invocationOptionsEmailFieldOptional" : @(IBGBugReportingInvocationOptionEmailFieldOptional),
519
+ @" invocationOptionsCommentFieldRequired" : @(IBGBugReportingInvocationOptionCommentFieldRequired),
520
+ @" invocationOptionsDisablePostSendingDialog" : @(IBGBugReportingInvocationOptionDisablePostSendingDialog),
521
+
504
522
@" colorThemeLight" : @(IBGColorThemeLight),
505
523
@" colorThemeDark" : @(IBGColorThemeDark),
506
524
0 commit comments