I have a code in react native. I use it to pass array to native module, and I want to handle it on native module,
Example of ReadableArray:
{"AuditScheduleDetailID":5525,"AuditAnswerId":33,"LocalFindingID":1,"LocalMediaID":1,"ExtFiles":"jpg"}
I want to get each value of key inside - how can I do that?
I've tried this article but I dont really understand it.
I just hardcoded it for now like this :
@ReactMethod
public void insert(ReadableArray name, String file) {
DatabaseHandler db = new DatabaseHandler(getReactApplicationContext());
String a = "path to file";
for(int i=0 ; i<name.size(); i++){
//expected result
int audit = 5525 //from AuditScheduleDetailID value
int answer = 33 // from AuditAnswerId value
int finding = 1 // from LocalFindingID value
int media = 1 // from LocalMediaID value
String exten = "jpg" // from ExtFiles value
db.addContact(new Contact(audit, answer, finding, media, exten));
}
}
Is there a way to get each value from readablearray key?