Skip to content

Commit 4555940

Browse files
committed
Add setDisclaimerText API
1 parent f2f8464 commit 4555940

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

src/android/IBGPlugin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,22 @@ public void setVideoRecordingFloatingButtonPosition(final CallbackContext callba
984984
}
985985
}
986986

987+
/**
988+
* Adds a disclaimer text within the bug reporting form, which can include hyperlinked text.
989+
* @param callbackContext Used when calling back into JavaScript
990+
* @param args [text: String]
991+
*/
992+
public void setDisclaimerText(final CallbackContext callbackContext, JSONArray args) {
993+
final String text = args.optString(0);
994+
try {
995+
BugReporting.setDisclaimerText(text);
996+
997+
callbackContext.success();
998+
} catch (Exception e) {
999+
callbackContext.error(e.getMessage());
1000+
}
1001+
}
1002+
9871003
/**
9881004
* Customize the attachment options available to users to send with a bug reeport.
9891005
*

src/ios/IBGPlugin.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,21 @@ - (void) setVideoRecordingFloatingButtonPosition:(CDVInvokedUrlCommand*)command
392392
callbackId:[command callbackId]];
393393
}
394394

395+
/**
396+
* Adds a disclaimer text within the bug reporting form, which can include hyperlinked text.
397+
* @param {CDVInvokedUrlCommand*} command
398+
* The command sent from JavaScript
399+
*/
400+
- (void)setDisclaimerText:(CDVInvokedUrlCommand*)command
401+
{
402+
NSString* text = [command argumentAtIndex:0];
403+
404+
[IBGBugReporting setDisclaimerText:text];
405+
406+
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK]
407+
callbackId:[command callbackId]];
408+
}
409+
395410
/**
396411
* Attaches a new copy of this file with each bug report sent
397412
* with a maximum size of 1 MB. Calling this method several

src/modules/BugReporting.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,28 @@ namespace BugReporting {
286286
error
287287
);
288288
};
289+
290+
/**
291+
* Adds a disclaimer text within the bug reporting form, which can include hyperlinked text.
292+
* @param text a String of the disclaimer text.
293+
* @param success callback on function success.
294+
* @param error callback on function error.
295+
*/
296+
export const setDisclaimerText = (
297+
text: string,
298+
success?: () => void,
299+
error?: (err: any) => void
300+
) => {
301+
exec("IBGPlugin", "setDisclaimerText", [text], success, error);
302+
};
303+
304+
export const setCommentMinimumCharacterCount = (
305+
limit: number,
306+
reportTypes: reportType[],
307+
success?: () => void,
308+
error?: (err: any) => void
309+
) => {
310+
exec("IBGPlugin", "setCommentMinimumCharacterCount", [limit, reportTypes], success, error);
311+
};
289312
}
290313
export = BugReporting;

0 commit comments

Comments
 (0)