diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 18239cf..ec9fd2e 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -8,6 +8,8 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.WritableArray; +import com.facebook.react.bridge.WritableNativeArray; import com.facebook.react.bridge.Callback; import com.instabug.library.Instabug; @@ -348,14 +350,18 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { * @see #resetTags() */ @ReactMethod - public ArrayList getTags() { - ArrayList tags = new ArrayList(); + public void getTags(Callback tagsCallback) { + private WritableArray tagsArray; try { - tags = mInstabug.getTags(); + ArrayList tags = mInstabug.getTags(); + tagsArray = new WritableNativeArray(); + for (int i = 0; i < tags.size(); i++) { + tagsArray.pushString(tags.get(i)); + } } catch (Exception e) { e.printStackTrace(); } - return tags; + tagsCallback.invoke(tagsArray); } /** diff --git a/index.js b/index.js index 290538a..6b3dd90 100644 --- a/index.js +++ b/index.js @@ -346,11 +346,7 @@ module.exports = { * @param {tagsCallback} tagsCallback callback with argument tags of reported feedback, bug or crash. */ getTags: function (tagsCallback) { - if (Platform.OS === 'ios') { - Instabug.getTags(tagsCallback); - } else if (Platform.OS === 'android') { - Instabug.getTags(); - } + Instabug.getTags(tagsCallback); }, /**