Skip to content

Commit 1814b37

Browse files
Enable appendTags APIs in android
1 parent a627d12 commit 1814b37

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ public void dismiss() {
149149
* @param tags
150150
*/
151151
@ReactMethod
152-
public void addTags(String tags) {
152+
public void appendTags(String tags) {
153153
try {
154154
String[] result = tags.split(",");
155-
mInstabug.resetTags(); //clear last commit tags
156155
mInstabug.addTags(result);
157156
} catch (Exception e) {
158157
e.printStackTrace();
@@ -692,8 +691,9 @@ public void setEmailFieldRequired(boolean isEmailFieldRequired) {
692691
/**
693692
* Sets whether users are required to enter a comment or not when sending reports.
694693
* Defaults to NO.
694+
*
695695
* @param {boolean} isCommentFieldRequired A boolean to indicate whether comment
696-
* field is required or not.
696+
* field is required or not.
697697
*/
698698
@ReactMethod
699699
public void setCommentFieldRequired(boolean isCommentFieldRequired) {

index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ module.exports = {
237237
* field is required or not.
238238
*/
239239
setEmailFieldRequired: function (isEmailFieldRequired) {
240-
Instabug.setEmailFieldRequired(isEmailFieldRequired);
240+
Instabug.setEmailFieldRequired(isEmailFieldRequired);
241241
},
242242

243243
/**
@@ -247,7 +247,7 @@ module.exports = {
247247
* field is required or not.
248248
*/
249249
setCommentFieldRequired: function (isCommentFieldRequired) {
250-
Instabug.setCommentFieldRequired(isCommentFieldRequired);
250+
Instabug.setCommentFieldRequired(isCommentFieldRequired);
251251
},
252252

253253
/**
@@ -329,9 +329,7 @@ module.exports = {
329329
* @param {string[]} tags An array of tags to append to current tags.
330330
*/
331331
appendTags: function (tags) {
332-
if (Platform.OS === 'ios')
333-
Instabug.appendTags(tags);
334-
332+
Instabug.appendTags(tags);
335333
},
336334

337335
/**
@@ -352,7 +350,11 @@ module.exports = {
352350
* @param {tagsCallback} tagsCallback callback with argument tags of reported feedback, bug or crash.
353351
*/
354352
getTags: function (tagsCallback) {
355-
Instabug.getTags(tagsCallback);
353+
if (Platform.OS === 'ios') {
354+
Instabug.getTags(tagsCallback);
355+
} else if (Platform.OS === 'android') {
356+
Instabug.getTags();
357+
}
356358
},
357359

358360
/**

0 commit comments

Comments
 (0)