Use case: Check a user subscription to a thread
Before you start
Before you check a user's subscription status to a thread, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to query thread subscription information. This typically requires basic access permissions to the collaboration system.
- Identify the Thread: You must have a valid thread identifier to check subscription status. Threads are identified by their root annotation ID.
- Identify the User: Understand that the current user's subscription status will be checked.
- Understand Subscription Context: Be aware that thread subscriptions determine which users 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...?
Check if the current user is subscribed to a thread
To determine if the currently authenticated user is subscribed to 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.
- Query Subscription Status: Use the SDK to check the current user's subscription state.
- Update UI: Modify your interface to display whether the user is subscribed to the thread or not.
Example:
var result = await annotationManagement.IsSubscribedToThreadAsync(
projectId: projectId,
annotationId: annotationId,
cancellationToken: cancellationToken);
var isSubscribed = result.IsSubscribed;
For more information on working with thread subscriptions, see the documentation on subscribing users to threads and unsubscribing users to threads.