according to this link I used react-native-contact to open contact list in android device so the user can choose one and and add it to list. but when I click a button to open a contact list, react-native-contacts getAll returns null.here is a code that I use:
openContactlist() {Contacts.getAll((err, contacts) => { if (err) { // throw err; alert("NO"); } // contacts returned alert("yes");}) }
in render of react native code there is a button that by clicking on it it call above function:
<Button title="From contact list" onPress={this.openContactlist} />
error:
null is not an object (evaluating '_react-native-contacts.getall')