I'm doing an app with a part native and a part with html. I need to send the phone contacts to the html part, which later parse the JSON passed to a json object in Javascript with JSON.parse. Sometimes, it fails and I don't have anyway to know in which contact is failing.
Some advice to know the error? In Android or in javacript, thank you.
JS parse
return new Promise((resolve, reject) => {
(<any>window).contactsOk = function (contacts) {
try {
const data = JSON.parse(contacts);
resolve(data);
} catch (error) {
console.log('Error parsing contacts info', error);
reject(error);
}
}