capacitor-community / contacts

Contacts Plugin for Capacitor
https://capacitor-community.github.io/contacts/
125 stars 54 forks source link

Accessing contact creation date #91

Closed charleswalter closed 1 year ago

charleswalter commented 1 year ago

Hi, I'm the founder of FriendApp. Thank you for your great work on this component.

I was wondering if the import process could also read the contact creation date for iPhone and Android? We're going through a lengthy workaround to detect new contacts added by users, and was curious to see if there might be an easier way to handle this is we could read the iphone and Android contact creation date.

Please feel free to download if you'd like to check out our app :) https://apps.apple.com/us/app/friend/id1599335622

tafelnl commented 1 year ago

Quick answer (from my mobile phone and without doing any further investigation ): AFAIK it's not possible to retrieve the creation date. The workaround would be to look at the id's, as these are mostly sequential. Unfortunately they are not garuanteed to be in the correct order however. So for example:

You have three contacts with the following ids: 1, 2, 3. A new contact will likely have the id 4. But imagine if contact with id 2 gets deleted. In that case a new contact might get the id 2.

Again I'm not entirely sure if this is actually the case. It's from what I remember. I would have to do some investigation to be sure.

charleswalter commented 1 year ago

Thx for responding, and great to meet you. Would love to get in touch. Curious to see how Apple IDs are handled. I found this app, which made me think it was available. But perhaps it's not date, just looking at something else incremental? https://apps.apple.com/us/app/recent-contacts-newest-digits/id1044097970

tafelnl commented 1 year ago

After some Googling, I'm pretty sure it's not possible to retrieve the creation date of a contact. It's not mentioned in the docs anywhere. Also auto-completion doesn't yield anything. The only mentions about creation date are StackOverflow / Apple Forum questions and answers that it isn't possible. So unfortunately you'll have to workaround this limitation.