66
77#import " InstabugReactBridge.h"
88#import < Instabug/Instabug.h>
9+ #import < Instabug/IBGBugReporting.h>
910#import < asl.h>
1011#import < React/RCTLog.h>
1112#import < os/log.h>
@@ -30,8 +31,12 @@ - (dispatch_queue_t)methodQueue {
3031 return dispatch_get_main_queue ();
3132}
3233
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];
3540 RCTAddLogFunction (InstabugReactLogFunction);
3641 RCTSetLogThreshold (RCTLogLevelInfo);
3742 [Instabug setNetworkLoggingEnabled: NO ];
@@ -42,13 +47,17 @@ - (dispatch_queue_t)methodQueue {
4247}
4348
4449RCT_EXPORT_METHOD (invoke) {
45- [Instabug invoke ];
50+ [IBGBugReporting invoke ];
4651}
4752
4853RCT_EXPORT_METHOD (invokeWithInvocationMode:(IBGInvocationMode)invocationMode) {
4954 [Instabug invokeWithInvocationMode: invocationMode];
5055}
5156
57+ RCT_EXPORT_METHOD (invokeWithInvocationModes:(IBGBugReportingInvocationOption)invocationOptions) {
58+ [Instabug invokeWithOptions: invocationOptions];
59+ }
60+
5261RCT_EXPORT_METHOD (dismiss) {
5362 [Instabug dismiss ];
5463}
@@ -501,6 +510,15 @@ - (NSDictionary *)constantsToExport
501510 @" localeSwedish" : @(IBGLocaleSwedish),
502511 @" localeTurkish" : @(IBGLocaleTurkish),
503512
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+
504522 @" colorThemeLight" : @(IBGColorThemeLight),
505523 @" colorThemeDark" : @(IBGColorThemeDark),
506524
0 commit comments