Quantcast
Viewing all articles
Browse latest Browse all 3

react-native-contacts getAll return null

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')

Image may be NSFW.
Clik here to view.
enter image description here


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>