KnownContactField.InstantMessage | instantMessage property

Applies to Windows only

[KnownContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactConnectedServiceAccount, or ContactEmail. ]

Contains the name of the field used for instant messaging accounts.

Syntax


var instantMessage = Windows.ApplicationModel.Contacts.KnownContactField.instantMessage;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The name of the field.

Remarks

Use this property with the ContactPicker.DesiredFields property to specify that you want to get the instant messaging names that a contact uses.

Examples

This code demonstrates how to get a contact's instant messaging information.


function getInstantMessageInfo() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.instantMessage);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        var contactData = contact.name + "<br/>";
        contactData += contact.instantMessages[0].displayText + "<br/>";
        contactData += contact.instantMessages[0].launchUri + "<br/>";
        contactData += contact.instantMessages[0].service + "<br/>";
        contactData += contact.instantMessages[0].userName + "<br/>";
        contactData += contact.instantMessages[0].category + "<br/>";
        contactData += contact.instantMessages[0].type;
        contactElement.innerHTML = contactData;
        document.body.appendChild(contactElement);
    });
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Metadata

Windows.winmd

See also

KnownContactField

 

 

Show:
© 2014 Microsoft. All rights reserved.