QuisApp / flutter_contacts

MIT License
88 stars 143 forks source link

Android Contacts in groups are not fetched #103

Closed yassinsameh closed 1 year ago

yassinsameh commented 1 year ago

Issue replicable in Android 13, flutter_contacts: ^1.1.6.

Steps to replicate:

1) Create a contact that has no group 2) await FlutterContacts.getContacts( withProperties: true, withGroups: true, deduplicateProperties: true, );

Result: Contact will be fetched correctly

3) Add that contact to a group (Besides the emergency group as that's the only one that works) 4) Use same Query in 2), The contact is not returned

@joachim-quis

felixkriechbaum commented 1 year ago

Same Behaviour in my project :/

yassinsameh commented 1 year ago

@joachimvalente Urgent, i have no kotlin experience but will try my best the next days, would be really appreciated if you could take a look, my app is on hold to release because of this.

felixkriechbaum commented 1 year ago

any new info to this bug ?

yassinsameh commented 1 year ago

Hi @felixkriechbaum , just resolved this. A way to have them fetched is to set includeNonVisibleOnAndroid to true using FlutterContacts.config.includeNonVisibleOnAndroid = true;

One thing to note is that this will also fetch a lot of contacts, some that have no numbers, you can read more about it here and depending on your use case you would have to handle cleaning and filtering through these contacts as you need. Good luck.