• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

react-native-contacts 6버전에서 바꿔줘야합니다.

21.01.24 23:11 작성 조회수 384

0

최신버전에서는 아래와 같이 바꿔줘야합니다.

//contacts 6버전대
      Contacts.getAll()
    .then((contacts=> {
      // work with contacts
    })
    .catch((e=> { //handle error 
   })

답변 2

·

답변을 작성해보세요.

0

somee2147님의 프로필

somee2147

2021.02.01

참고해주세요
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

장태영님의 프로필

장태영

2021.01.29

최신버전으로 수정하신 코드를 공유해 주실 수 있으신가요??..ㅠ