0

Hello friends i want to create library for native module call so below is my code

Mylib is my library project in android

package com.reactlibrary;

import java.util.ArrayList;

public class RNMyLibModule extends ReactContextBaseJavaModule {

private final ReactApplicationContext reactContext;

public RNMyLibModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}

@ReactMethod
public void getTags(String qrcode, Callback errCallback, Callback succCallback) throws Throwable {
ArrayList<TagInfo> tagInfos;

tagInfos = parseTag();

try {
    succCallback.invoke(tagInfos);
}catch (IllegalViewOperationException e)
 {
  errCallback.invoke(e.getMessage());
  }
}

@Override
public String getName() {
return "RNMyLib";
  }
}

I call it from my js as below

MyLib.getTags("call", (msg) => {
  console.log("Error message " + msg)
}, (getTags) => {

  console.log("GET Tags in REact Native: "+getTags)
});

when i run above code i got error like "Can not connect argument of type class TagInfo"

any idea how can i solve this ? your all suggestions are appreciable.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.