This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/react-native/annotations/create-edit-and-remove/detect-changes.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Detect if PDF annotation has changed in React Native | Nutrient

Nutrient React Native SDK lets you detect when one or more annotations have changed via the AnnotationEvent event listeners. Here’s how to register for the event listeners to be notified when one or more annotations have changed:

override componentDidMount() {
this.pdfRef.current?.getNotificationCenter().subscribe(NotificationCenter.AnnotationsEvent.CHANGED, (event: any) => {
Alert.alert('Nutrient', JSON.stringify(event));
});
this.pdfRef.current?.getNotificationCenter().subscribe(NotificationCenter.AnnotationsEvent.ADDED, (event: any) => {
Alert.alert('Nutrient', JSON.stringify(event));
});
this.pdfRef.current?.getNotificationCenter().subscribe(NotificationCenter.AnnotationsEvent.REMOVED, (event: any) => {
Alert.alert('Nutrient', JSON.stringify(event));
});
}

When done, remember to unregister from the event listeners:

override componentWillUnmount () {
this.pdfRef.current?.getNotificationCenter().unsubscribe(NotificationCenter.AnnotationsEvent.CHANGED);
this.pdfRef.current?.getNotificationCenter().unsubscribe(NotificationCenter.AnnotationsEvent.ADDED);
this.pdfRef.current?.getNotificationCenter().unsubscribe(NotificationCenter.AnnotationsEvent.REMOVED);
}