morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.64k stars 560 forks source link

Contacts reading issue in Android " Malformed calls from JS: field sizes are different ..." due to incorrect syntax mentioned in READme.md #647

Closed sreerajmp closed 2 years ago

sreerajmp commented 2 years ago

Read me contains incorrect syntax getall contacts. ie:

import` { PermissionsAndroid } from 'react-native';
import Contacts from 'react-native-contacts';

PermissionsAndroid.request(
  PermissionsAndroid.PERMISSIONS.READ_CONTACTS,
  {
    'title': 'Contacts',
    'message': 'This app would like to view your contacts.',
    'buttonPositive': 'Please accept bare mortal'
  }
)
.then(Contacts.getAll)
.then(contacts => {
  ...
})

This causes the following error in android: WhatsApp Image 2021-11-19 at 2 36 16 AM

gsietsetb commented 2 years ago

I had the exact same issue and needed to downgrade to : "react-native-contacts": "5.0.2",

morenoh149 commented 2 years ago

the latest api uses promises. Please use the latest apis. The usage in the readme is now fixed showing the promises api.

github-actions[bot] commented 2 years ago

This issue is stale, please provide more information about the status