@@ -145,10 +145,31 @@ - (dispatch_queue_t)methodQueue {
145
145
RCT_EXPORT_METHOD (setPostInvocationHandler:(RCTResponseSenderBlock)callBack) {
146
146
if (callBack != nil ) {
147
147
IBGBugReporting.didDismissHandler = ^(IBGDismissType dismissType, IBGReportType reportType) {
148
- [self sendEventWithName: @" IBGpostInvocationHandler" body: @{
149
- @" dismissType" : @(dismissType),
150
- @" reportType" : @(reportType)
151
- }];
148
+ NSLog (@" Dismiss Type: %ld " ,(long )dismissType);
149
+ NSLog (@" Report Type: %ld " ,(long )reportType);
150
+
151
+ // parse dismiss type enum
152
+ NSString * dismissTypeString;
153
+ if (dismissType == IBGDismissTypeCancel) {
154
+ dismissTypeString = @" CANCEL" ;
155
+ } else if (dismissType == IBGDismissTypeSubmit) {
156
+ dismissTypeString = @" SUBMIT" ;
157
+ } else if (dismissType == IBGDismissTypeAddAttachment) {
158
+ dismissTypeString = @" ADD_ATTACHMENT" ;
159
+ }
160
+
161
+ // parse report type enum
162
+ NSString * reportTypeString;
163
+ if (reportType == IBGReportTypeBug) {
164
+ reportTypeString = @" bug" ;
165
+ } else if (reportType == IBGReportTypeFeedback) {
166
+ reportTypeString = @" feedback" ;
167
+ } else {
168
+ reportTypeString = @" other" ;
169
+ }
170
+ NSDictionary *result = @{ @" dismissType" : dismissTypeString,
171
+ @" reportType" : reportTypeString};
172
+ [self sendEventWithName: @" IBGpostInvocationHandler" body: result];
152
173
};
153
174
} else {
154
175
IBGBugReporting.didDismissHandler = nil ;
@@ -157,9 +178,22 @@ - (dispatch_queue_t)methodQueue {
157
178
158
179
RCT_EXPORT_METHOD (didSelectPromptOptionHandler:(RCTResponseSenderBlock)callBack) {
159
180
if (callBack != nil ) {
181
+
160
182
IBGBugReporting.didSelectPromptOptionHandler = ^(IBGPromptOption promptOption) {
183
+
184
+ NSString *promptOptionString;
185
+ if (promptOption == IBGPromptOptionBug) {
186
+ promptOptionString = @" bug" ;
187
+ } else if (promptOption == IBGReportTypeFeedback) {
188
+ promptOptionString = @" feedback" ;
189
+ } else if (promptOption == IBGPromptOptionChat) {
190
+ promptOptionString = @" chat" ;
191
+ } else {
192
+ promptOptionString = @" none" ;
193
+ }
194
+
161
195
[self sendEventWithName: @" IBGDidSelectPromptOptionHandler" body: @{
162
- @" promptOption" : @(promptOption)
196
+ @" promptOption" : promptOptionString
163
197
}];
164
198
};
165
199
} else {
0 commit comments