Skip to content

Instantly share code, notes, and snippets.

@ShanikaNishadhi
Created November 19, 2020 22:24
Show Gist options
  • Save ShanikaNishadhi/5798f048f6ff033979bb0a54acadd0aa to your computer and use it in GitHub Desktop.
Save ShanikaNishadhi/5798f048f6ff033979bb0a54acadd0aa to your computer and use it in GitHub Desktop.
import { PermissionsAndroid } from 'react-native';
import Contacts from 'react-native-contacts';
PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.READ_CONTACTS,
{
'title': 'Contacts',
'message': 'Let us us access your contacts',
'buttonPositive': 'Please accept'
}
)
.then(Contacts.getAll)
.then(contacts => {
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment