Closed fgubler closed 1 year ago
thanks for the feature request @fgubler and the detailed issue.
Would it be possible to add the option to filter contactStore.fetchContactGroups() by Account?
I will have a look into this and let you know. If it is something supported by Android i would be more than happy to support it.
When using contactStore.execute { insertGroup(myGroup) } where is it actually saved?
I think it is the phone's (offline), if it follows what saving a contact does without specifying an account
would be great if it were able to specify exactly into which account to store it
seems reasonable. i will need to have a look how it is done from android's side first and will let you know.
Thanks a lot 😍
Just pushed this to 1.6.0.
The way to insert a new group into a specific account is:
contactStore.execute {
insertGroup(intoAccount = InternetAccount(...)) {
title = "My Group"
}
}
to update a group you can:
val updatedCopy = group.mutableCopy {
note = "Updated Note"
title = "Updated Title"
account = InternetAccount("test@test.com", "test.com")
}
contactStore.execute {
updateGroup(updatedCopy)
}
I will close this issue once the new version is available on maven
This is now live in 1.7.0.
Now the contact groups you fetch are going to include an account
property that contains information about which account the contact group is saved into. a null account means the group is stored locally (offline).
Closing this as it is now live
Great, thank youbl so much :-) I will try it as soon as I get back from vacation.
Seems to work splendidly, thanks :-)
Hi
I have encountered an interesting problem this weekend:
contactStore.fetchContactGroups()
to load all existing ContactGroups to compare them by id (and name as fallback). But the problem is that - if I understood it correctly - that is an aggregated list over all accounts on the phone.Does that description make any sense?
If yes, I have two questions / wishes
contactStore.fetchContactGroups()
by Account?contactStore.execute { insertGroup(myGroup) }
where is it actually saved? Into the phone's local contacts? Into all the accounts? Into the "default" account? => would be great if it were able to specify exactly into which account to store it