I know about three mechanisms:
- Save Tasks (e.g. SaveEmailAddressTask) which can be used to save specific info like a PhoneNumber or an EmailAddress into a contact selected by the user
- SaveContactTask which can be used to create a new contact
- the Contacts API (Microsoft.Phone.UserData.Contacts), which can be used to search/enumerate through contacts.
What I’m missing is a way to write a piece of data (e.g. a Note) into a contact (e.g. a Contact that gets returned from the Contacts.SearchAsync() API).
Is this possible with Windows Phone 7.1?
Stepping back, what I’m trying to do is put up some UI that allows the user to pick a contact, and import all the information (phone numbers, email addresses, etc) into a record in my app.
The problem I’m trying to solve is to identify whether I have ever visited that contact before and imported its data – if so, I just want to refresh it (as opposed to creating a new, duplicate contact).
An alternative approach to writing data into the contact would be to save a unique ID associated with the contact I imported, but I don’t see a property like that on Contact either…
There isn’t anything like this in v7.1 of the SDK, so you may have to look into approaches for defining your own candidate key, and given the nature of the data, you’ll probably have to define several heuristics to determine your confidence of a match, and cope with several moving targets (names, numbers and email addresses can all change, and none are distinct).