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 8
8
import com .facebook .react .bridge .ReactMethod ;
9
9
import com .facebook .react .bridge .ReadableArray ;
10
10
import com .facebook .react .bridge .ReadableMap ;
11
+ import com .facebook .react .bridge .WritableArray ;
12
+ import com .facebook .react .bridge .WritableNativeArray ;
11
13
import com .facebook .react .bridge .Callback ;
12
14
13
15
import com .instabug .library .Instabug ;
@@ -348,14 +350,18 @@ public void IBGLog(String message) {
348
350
* @see #resetTags()
349
351
*/
350
352
@ ReactMethod
351
- public ArrayList < String > getTags () {
352
- ArrayList < String > tags = new ArrayList < String >() ;
353
+ public void getTags (Callback tagsCallback ) {
354
+ private WritableArray tagsArray ;
353
355
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
+ }
355
361
} catch (Exception e ) {
356
362
e .printStackTrace ();
357
363
}
358
- return tags ;
364
+ tagsCallback . invoke ( tagsArray ) ;
359
365
}
360
366
361
367
/**
Original file line number Diff line number Diff line change @@ -346,11 +346,7 @@ module.exports = {
346
346
* @param {tagsCallback } tagsCallback callback with argument tags of reported feedback, bug or crash.
347
347
*/
348
348
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 ) ;
354
350
} ,
355
351
356
352
/**
You can’t perform that action at this time.
0 commit comments