apache/cordova-plugin-contacts

Already imported contact not removed fully from device

Closed this issue · 12 comments

I think when importing data from device all contacts also saved in app-local storage.
How can I get new contact list ?

What platform?
What are you doing exactly and what is happening that you do not expect?

In iOS and Android (iOS 6 and Samsung Galaxy s8).

  1. Run app and import all contact
  2. Close app
  3. Go to native contacts page
  4. Delete one of imported contacts
  5. Run app

When getting contact list from device already deleted contact will be imported again.

In my Sony Xperia Z1 when deleting contact from native page it's show this popup
screenshot_2018-09-28-17-11-05

For getting all contacts I'm using this method
this.contacts.find(['displayName'], {filter: ''});

Did the contact actually get deleted in the native app? Is it gone there?

After deleting contact from contact list of device and after that again fetch list in app I can see deleted contact in my app.

I repeat: Did you confirm that the contact was actually and really deleted from the device?

Yes its removed from device.

Does this only happen on devices where you get this popup on deleting the contact or on others as well?

On all devices.

@rhanesoghlyan: If you do a new find, you will get an updated list right? It is not that these contacts are saved locally, they are just still available in memory as doing a find is a heavy call which can take a lot of time and you dont want to do this every single time for every component in the UI.

I do not think this should be a problem, although you always have to do a find (with the specific id of that user) before doing any action as contact might be removed or updated in between else it might throw an error or even crash.

But I do not think you can expect that magically memory in your app gets updated when a contact is updated/removed in the native contacts app.

We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.