-
In my previous code I'm using the "ContactsContract.RawContacts.SOURCE_ID" Field to store my contact primary key provided from backend. How can I achieve this with this library? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Hey! This is a great callout! Currently, the library does not support setting or reading the Just to make sure we are in the same page about the purpose of this field, here's what I know about it; https://developer.android.com/reference/android/provider/ContactsContract.RawContacts There are two use cases where the source ID is set,
In other words, we need to be able to set the
I believe you mean the Contact "lookup key", which is automatically set by the Contacts Provider. The value of the Contact's lookup key typically uses the RawContact's source id (if it is not null) as a part of a larger string. I did find that setting an existing RawContact's source id results in an automatic change to the Contact's lookup key. |
Beta Was this translation helpful? Give feedback.
-
@marrale, I created an issue for adding support for your use case; #300. It will be included in the next release (0.3.1). In the meantime, you should still be able to use this library right now to make your life easier. If you want to adopt this library now instead of waiting for the next release, you can do this in order to insert a new RawContact with the source id provided from your backend...
Or, to make sure a new RawContact is not created in the backend side when a new RawContact is created locally without a source ID, you can instead...
Regardless of whether you are or will be using this library, thanks for starting this discussion and look forward to #300 🙏 ❤️ |
Beta Was this translation helpful? Give feedback.
-
By the way, I also went ahead and created an issue for supporting CRUD operations on Group's SOURCE_ID; #303. It's pretty much the same as what has been discussed here, except instead of RawContacts, it is Groups. |
Beta Was this translation helpful? Give feedback.
@marrale, I created an issue for adding support for your use case; #300. It will be included in the next release (0.3.1).
In the meantime, you should still be able to use this library right now to make your life easier. If you want to adopt this library now instead of waiting for the next release, you can do this in order to insert a new RawContact with the source id provided from your backend...
Or, to make sure a new RawContact…