File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 88import com .facebook .react .bridge .ReactMethod ;
99import com .facebook .react .bridge .ReadableArray ;
1010import com .facebook .react .bridge .ReadableMap ;
11+ import com .facebook .react .bridge .WritableArray ;
12+ import com .facebook .react .bridge .WritableNativeArray ;
1113import com .facebook .react .bridge .Callback ;
1214
1315import com .instabug .library .Instabug ;
@@ -348,14 +350,18 @@ public void IBGLog(String message) {
348350 * @see #resetTags()
349351 */
350352 @ ReactMethod
351- public ArrayList < String > getTags () {
352- ArrayList < String > tags = new ArrayList < String >() ;
353+ public void getTags (Callback tagsCallback ) {
354+ private WritableArray tagsArray ;
353355 try {
354- tags = mInstabug .getTags ();
356+ ArrayList <String > tags = mInstabug .getTags ();
357+ tagsArray = new WritableNativeArray ();
358+ for (int i = 0 ; i < tags .size (); i ++) {
359+ tagsArray .pushString (tags .get (i ));
360+ }
355361 } catch (Exception e ) {
356362 e .printStackTrace ();
357363 }
358- return tags ;
364+ tagsCallback . invoke ( tagsArray ) ;
359365 }
360366
361367 /**
Original file line number Diff line number Diff line change @@ -346,11 +346,7 @@ module.exports = {
346346 * @param {tagsCallback } tagsCallback callback with argument tags of reported feedback, bug or crash.
347347 */
348348 getTags : function ( tagsCallback ) {
349- if ( Platform . OS === 'ios' ) {
350- Instabug . getTags ( tagsCallback ) ;
351- } else if ( Platform . OS === 'android' ) {
352- Instabug . getTags ( ) ;
353- }
349+ Instabug . getTags ( tagsCallback ) ;
354350 } ,
355351
356352 /**
You can’t perform that action at this time.
0 commit comments