when I update a contacts socialmedia information using the socialmedia label "custom", the information is not stored correctly on the device. The socialmedia label is changed to "aim" and the the custom label is lost if I fetch the contact after the update. Updating the socialmedia information with other labels seems to be working. The socialmedia usernames are stored correctly and updating other values like the name works fine as well. Setting custom labels on the device contact menu and fetching them with flutter_contacts works as well, thus I assume the issue is caused by the update method. Currently im testing on an Android emulator (Pixel 4, API: 30). Code example is below.
Contact? contact = await FlutterContacts.openExternalPick();
if (contact == null) return;
// We need to fetch contact again with accounts (including the raw id)
// to be able to update the contact later (required for android)
contact = await FlutterContacts.getContact(
contact.id,
withAccounts: true,
withProperties: true,
);
List<SocialMedia> socialMedias = [
SocialMedia(
"test1",
label: SocialMediaLabel.custom,
customLabel: "CustomLabel1",
),
SocialMedia(
"test2",
label: SocialMediaLabel.jabber,
),
];
contact?.socialMedias = socialMedias;
contact?.update();
// Output 1:
print(contact?.socialMedias);
if (contact == null) return;
contact = await FlutterContacts.getContact(
contact.id,
withAccounts: true,
withProperties: true,
);
// Output 2:
print(contact?.socialMedias);
Hi,
when I update a contacts socialmedia information using the socialmedia label "custom", the information is not stored correctly on the device. The socialmedia label is changed to "aim" and the the custom label is lost if I fetch the contact after the update. Updating the socialmedia information with other labels seems to be working. The socialmedia usernames are stored correctly and updating other values like the name works fine as well. Setting custom labels on the device contact menu and fetching them with flutter_contacts works as well, thus I assume the issue is caused by the update method. Currently im testing on an Android emulator (Pixel 4, API: 30). Code example is below.
Output 1:
Output 2: