PeerContact.SubscribeAsync(Object) Method

Definition

Asynchronously subscribes the calling peer to the PeerContact, and as a result, the peer will receive any future PeerCollaboration events associated with the PeerContact.

C#
public virtual void SubscribeAsync(object userToken);

Parameters

userToken
Object

A user-defined Object that contains information about the SubscribeAsync(Object) operation.

Exceptions

userToken cannot be null.

The calling peer is not signed in to People Near Me.

The PeerContact object has been disposed.

Remarks

The SubscribeCompleted event is raised upon completion of this operation. If collaboration activities are not required to be asynchronous, the Subscribe method should be used instead.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also