8
8
#import < Instabug/Instabug.h>
9
9
#import < Instabug/IBGBugReporting.h>
10
10
#import < Instabug/IBGCrashReporting.h>
11
+ #import < Instabug/IBGSurveys.h>
11
12
#import < Instabug/IBGLog.h>
12
13
#import < asl.h>
13
14
#import < React/RCTLog.h>
@@ -96,11 +97,11 @@ - (dispatch_queue_t)methodQueue {
96
97
}
97
98
98
99
RCT_EXPORT_METHOD (showSurveyWithToken:(NSString *)surveyToken) {
99
- [Instabug showSurveyWithToken: surveyToken];
100
+ [IBGSurveys showSurveyWithToken: surveyToken];
100
101
}
101
102
102
103
RCT_EXPORT_METHOD (hasRespondedToSurveyWithToken:(NSString *)surveyToken callback:(RCTResponseSenderBlock)callback) {
103
- callback (@[@([Instabug hasRespondedToSurveyWithToken: surveyToken])]);
104
+ callback (@[@([IBGSurveys hasRespondedToSurveyWithToken: surveyToken])]);
104
105
}
105
106
106
107
RCT_EXPORT_METHOD (setUserStepsEnabled:(BOOL )isUserStepsEnabled) {
@@ -367,6 +368,10 @@ - (dispatch_queue_t)methodQueue {
367
368
Instabug.shouldCaptureViewHierarchy = viewHierarchyEnabled;
368
369
}
369
370
371
+ RCT_EXPORT_METHOD (getAvailableSurveys:(RCTResponseSenderBlock)callback) {
372
+ callback (@[[IBGSurveys availableSurveys ]]);
373
+ }
374
+
370
375
RCT_EXPORT_METHOD (logUserEventWithName:(NSString *)name) {
371
376
[Instabug logUserEventWithName: name];
372
377
}
@@ -400,30 +405,30 @@ - (dispatch_queue_t)methodQueue {
400
405
}
401
406
402
407
RCT_EXPORT_METHOD (setSurveysEnabled:(BOOL )surveysEnabled) {
403
- [Instabug setSurveysEnabled: surveysEnabled] ;
408
+ IBGSurveys. enabled = surveysEnabled;
404
409
}
405
410
406
411
RCT_EXPORT_METHOD (showSurveysIfAvailable) {
407
- [Instabug showSurveyIfAvailable ];
412
+ [IBGSurveys showSurveyIfAvailable ];
408
413
}
409
414
410
415
RCT_EXPORT_METHOD (setWillShowSurveyHandler:(RCTResponseSenderBlock)callBack) {
411
416
if (callBack != nil ) {
412
- [Instabug setWillShowSurveyHandler: ^{
417
+ IBGSurveys. willShowSurveyHandler = ^{
413
418
[self sendEventWithName: @" IBGWillShowSurvey" body: nil ];
414
- }] ;
419
+ };
415
420
} else {
416
- [Instabug setWillShowSurveyHandler: nil ] ;
421
+ IBGSurveys. willShowSurveyHandler = nil ;
417
422
}
418
423
}
419
424
420
425
RCT_EXPORT_METHOD (setDidDismissSurveyHandler:(RCTResponseSenderBlock)callBack) {
421
426
if (callBack != nil ) {
422
- [Instabug setDidDismissSurveyHandler: ^{
427
+ IBGSurveys. didDismissSurveyHandler = ^{
423
428
[self sendEventWithName: @" IBGDidDismissSurvey" body: nil ];
424
- }] ;
429
+ };
425
430
} else {
426
- [Instabug setDidDismissSurveyHandler: nil ] ;
431
+ IBGSurveys. didDismissSurveyHandler = nil ;
427
432
}
428
433
}
429
434
@@ -432,15 +437,15 @@ - (dispatch_queue_t)methodQueue {
432
437
}
433
438
434
439
RCT_EXPORT_METHOD (setAutoShowingSurveysEnabled:(BOOL )autoShowingSurveysEnabled) {
435
- [Instabug setAutoShowingSurveysEnabled: autoShowingSurveysEnabled] ;
440
+ IBGSurveys. autoShowingEnabled = autoShowingSurveysEnabled;
436
441
}
437
442
438
443
RCT_EXPORT_METHOD (setVideoRecordingFloatingButtonPosition:(IBGPosition)position) {
439
444
IBGBugReporting.videoRecordingFloatingButtonPosition = position;
440
445
}
441
446
442
447
RCT_EXPORT_METHOD (setThresholdForReshowingSurveyAfterDismiss:(NSInteger )sessionCount daysCount:(NSInteger )daysCount) {
443
- [Instabug setThresholdForReshowingSurveyAfterDismiss: sessionCount daysCount: daysCount];
448
+ [IBGSurveys setThresholdForReshowingSurveyAfterDismiss: sessionCount daysCount: daysCount];
444
449
}
445
450
446
451
RCT_EXPORT_METHOD (setSessionProfilerEnabled:(BOOL )sessionProfilerEnabled) {
@@ -452,7 +457,7 @@ - (dispatch_queue_t)methodQueue {
452
457
}
453
458
454
459
RCT_EXPORT_METHOD (setShouldShowSurveysWelcomeScreen:(BOOL )shouldShowWelcomeScreen) {
455
- [Instabug setShouldShowSurveysWelcomeScreen: shouldShowWelcomeScreen] ;
460
+ IBGSurveys. shouldShowWelcomeScreen = shouldShowWelcomeScreen;
456
461
}
457
462
458
463
RCT_EXPORT_METHOD (setEmailFieldRequiredForActions:(BOOL )isEmailFieldRequired
0 commit comments