인프런 커뮤니티 질문&답변
react-native-contacts 6버전에서 바꿔줘야합니다.
작성
·
610
0
최신버전에서는 아래와 같이 바꿔줘야합니다.
//contacts 6버전대
Contacts.getAll()
.then((contacts) => {
// work with contacts
})
.catch((e) => { //handle error
})
답변 2
0
참고해주세요
const getContacts = () => {
requestContactPermission().then((didGetPermission) => {
if (didGetPermission) {
Contacts.getAll()
.then((contacts) => {
// console.warn(contacts);
setMyContacts(contacts);
})
.catch((err) => {
console.error(err);
throw err;
});
} else {
alert('no permission');
}
});
};
0




