Use case: Check a user subscription to an Annotation Thread
Before you start
Before you check a user's subscription status to an Annotation Thread, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to query Annotation Thread subscription information. This typically requires basic access permissions to the collaboration system.
- Identify the Annotation Thread: You must have a valid Annotation Thread identifier to check subscription status. Annotation 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 Annotation Thread subscriptions determine which users 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...?
Check if the current user is subscribed to an Annotation Thread
To determine if the currently authenticated user is subscribed to 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.
- 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 Annotation Thread or not.
Example:
var annotationReference = new AnnotationReference(projectId, annotationId);
var result = await annotationManagement.IsSubscribedToAnnotationThreadAsync(
annotationReference,
cancellationToken);
var isSubscribed = result.IsSubscribed;
For more information on working with Annotation Thread subscriptions, see the documentation on subscribing users to Annotation Threads and unsubscribing users from Annotation Threads.
See the API documentation for more details on the IsSubscribedToAnnotationThreadAsync method.