Export (0) Print
Expand All

Managing Watchers

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

A watcher (also known as a subscriber) is an entity who receives the presence information published by a publishing presentity. When one user subscribes to another user's presence by passing a non-null contextData parameter in the RemotePresentitySubscriptionTarget (uri, contextData) constructor, and intends to build a contact relationship with the publishing user, the server notifies the publishing user of the subscription request.

After the publishing user is notified with the subscription request, he or she is expected to acknowledge the request to the server so that the server can remove the entry that caused the notification to occur. This is an opportunity for the publishing user to find out who is subscribing to the information being published, and to place the subscribing user in the appropriate access control list (ACL) using the update operations in the ContainerUpdateOperation class. The notified user acknowledges the request by calling the BeginAcknowledgeSubscriber() method, which is declared as follows:

public IAsyncResult BeginAcknowledgeSubscriber(string subscriberId, AsyncCallback userCallback, object state);

An application can register for watcher notification by registering a handler for the SubscriberNotificationReceived event on a LocalOwnerPresence instance. The SubscriberNotificationEventArgs class, which is associated with this event, has a WatcherList property that lists all watchers who have subscribed to the application’s presence information.


If the WatcherList property contains multiple new watchers, acknowledge only the first one.

Notification is not a gatekeeping mechanism. A user cannot prevent others from adding him or her to their list although the user being added can determine whether to use the existing container membership for this subscriber or update the container membership for this subscriber.

© 2014 Microsoft