Use case: Unsubscribe a user from a thread
Before you start
Before you unsubscribe a user from a thread, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to manage thread subscriptions. Typically, users can unsubscribe themselves, while administrators might be able to manage subscriptions for others.
- Identify the Thread: You must have a valid thread identifier for the thread from which you want to unsubscribe the user. Threads are typically identified by their root annotation ID or a dedicated thread ID.
- Identify the User: Determine which user should be unsubscribed from the thread. This could be the current user or another user (if you have administrative access).
- Understand Unsubscription Effects: Be aware that unsubscribing from a thread means the user will no longer receive notifications about 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 thread subscription system.
How do I...?
Unsubscribe the current user from a thread
To unsubscribe the currently authenticated user from a specific 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 thread.
- Execute the Unsubscription: Use the SDK to unsubscribe the current user to the thread.
- Update UI: Modify your interface to indicate the user is now unsubscribed.
Example:
await annotationManagement.UnsubscribeFromThreadAsync(
projectId: projectId,
annotationId: annotationId,
cancellationToken: cancellationToken);
For more information on working with thread subscriptions, see the documentation on checking user subscription status and subscribing users to threads.
See the API documentation for more details on the UnsubscribeFromThreadAsync method.