Enable appendTags APIs in android

This commit is contained in:
DevHossamHassan 2017-06-20 00:03:22 +02:00
parent a627d12031
commit 1814b37b85
2 changed files with 11 additions and 9 deletions

View File

@ -149,10 +149,9 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* @param tags
*/
@ReactMethod
public void addTags(String tags) {
public void appendTags(String tags) {
try {
String[] result = tags.split(",");
mInstabug.resetTags(); //clear last commit tags
mInstabug.addTags(result);
} catch (Exception e) {
e.printStackTrace();
@ -692,8 +691,9 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
/**
* Sets whether users are required to enter a comment or not when sending reports.
* Defaults to NO.
*
* @param {boolean} isCommentFieldRequired A boolean to indicate whether comment
* field is required or not.
* field is required or not.
*/
@ReactMethod
public void setCommentFieldRequired(boolean isCommentFieldRequired) {

View File

@ -237,7 +237,7 @@ module.exports = {
* field is required or not.
*/
setEmailFieldRequired: function (isEmailFieldRequired) {
Instabug.setEmailFieldRequired(isEmailFieldRequired);
Instabug.setEmailFieldRequired(isEmailFieldRequired);
},
/**
@ -247,7 +247,7 @@ module.exports = {
* field is required or not.
*/
setCommentFieldRequired: function (isCommentFieldRequired) {
Instabug.setCommentFieldRequired(isCommentFieldRequired);
Instabug.setCommentFieldRequired(isCommentFieldRequired);
},
/**
@ -329,9 +329,7 @@ module.exports = {
* @param {string[]} tags An array of tags to append to current tags.
*/
appendTags: function (tags) {
if (Platform.OS === 'ios')
Instabug.appendTags(tags);
Instabug.appendTags(tags);
},
/**
@ -352,7 +350,11 @@ module.exports = {
* @param {tagsCallback} tagsCallback callback with argument tags of reported feedback, bug or crash.
*/
getTags: function (tagsCallback) {
Instabug.getTags(tagsCallback);
if (Platform.OS === 'ios') {
Instabug.getTags(tagsCallback);
} else if (Platform.OS === 'android') {
Instabug.getTags();
}
},
/**