I trying delete a contact from my list with react-native-contact library.
I using my phone as emulator so i can access my contact list. But when i try delete one my phone giving alert and telling like .
("ProjectName" trying delete your contacts. You cant delete contacts with 3rd party programms. Instead of that use MIUI contact list for delete )
But i must delete with my application. How can i do it ? My phone is : Xiaomi mi 8 and my codes :
For Delete :
import Contacts from 'react-native-contacts';
.
.
.
const deleteItem = item=> {
Alert.alert(
'Kayıt Silinecektir!',
`${item.displayName} kaydı silinecektir. Emin misiniz ?`,
[
{
text: 'Vazgeç',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{
text: 'Sil',
onPress: async () => {
const resp = await Contacts.deleteContact({recordID: item.contactId});
},
},
],
);
};