mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 14:40:54 +00:00
Update setReportCategories API params
To accept one or more category as an array
This commit is contained in:
parent
135b6219f0
commit
36e99be64c
@ -636,12 +636,13 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
||||
* @param reportCategories the report categories list which is a list of ReportCategory model
|
||||
*/
|
||||
@ReactMethod
|
||||
public void setReportCategories(String... categoriesTitles) {
|
||||
public void setReportCategories(ReadableArray categoriesTitles) {
|
||||
try {
|
||||
ArrayList<ReportCategory> bugCategories = new ArrayList<>();
|
||||
|
||||
for (String category : categoriesTitles) {
|
||||
bugCategories.add(ReportCategory.getInstance().withLabel(category));
|
||||
int size = categoriesTitles != null ? categoriesTitles.size() : 0;
|
||||
if (size == 0) return;
|
||||
for (int i = 0; i < size; i++) {
|
||||
bugCategories.add(ReportCategory.getInstance().withLabel(categoriesTitles.getString(i)));
|
||||
}
|
||||
|
||||
Instabug.setReportCategories(bugCategories);
|
||||
|
2
index.js
2
index.js
@ -497,7 +497,7 @@ module.exports = {
|
||||
* to. Selected category will be shown as a tag on your dashboard.
|
||||
* @param {array} titles titles to be shown in the list.
|
||||
*/
|
||||
setReportCategories: function (titles) {
|
||||
setReportCategories: function (... titles) {
|
||||
if (Platform.OS == 'ios') {
|
||||
Instabug.setReportCategories(titles, null);
|
||||
} else if (Platform.OS == 'android') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user