Use case: Unsubscribe a user from an Annotation Thread
Before you start
Before you unsubscribe a user from an Annotation Thread, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to manage Annotation Thread subscriptions. Typically, users can unsubscribe themselves, while administrators might be able to manage subscriptions for others.
- Identify the Annotation Thread: You must have a valid Annotation Thread identifier for the Annotation Thread from which you want to unsubscribe the user. Annotation Threads are typically identified by their root annotation ID or a dedicated Annotation Thread ID.
- Identify the User: Determine which user should be unsubscribed from the Annotation Thread. This could be the current user or another user (if you have administrative access).
- Understand Unsubscription Effects: Be aware that unsubscribing from an Annotation Thread means the user will no longer receive notifications about Annotation Thread activity, such as new replies, status changes, or mentions.
- Set Up SDK Environment: Ensure your Unity environment is properly configured with the Collaboration SDK to interact with the Annotation Thread subscription system.
How do I...?
Unsubscribe the current user from an Annotation Thread
To unsubscribe the currently authenticated user from a specific Annotation Thread:
- Obtain the Project Identifier: Ensure you have the correct project identifier (GUID) for the project.
- Obtain the Annotation Identifier: Ensure you have the correct annotation identifier (GUID) for the root annotation identifying the Annotation Thread.
- Execute the Unsubscription: Use the SDK to unsubscribe the current user from the Annotation Thread.
- Update UI: Modify your interface to indicate the user is now unsubscribed.
Example:
var annotationReference = new AnnotationReference(projectId, annotationId);
await annotationManagement.UnsubscribeFromAnnotationThreadAsync(
annotationReference,
cancellationToken);
For more information on working with Annotation Thread subscriptions, see the documentation on checking user subscription status and subscribing users to Annotation Threads.
See the API documentation for more details on the UnsubscribeFromAnnotationThreadAsync method.