---
title: "React Native PDF viewer events | Nutrient React Native SDK"
canonical_url: "https://www.nutrient.io/guides/react-native/events-and-notifications/viewer/"
md_url: "https://www.nutrient.io/guides/react-native/events-and-notifications/viewer.md"
last_updated: "2026-05-15T19:10:05.056Z"
description: "Discover how to register for viewer events."
---

# Viewer events

Nutrient React Native SDK provides a [`NotificationCenter`](https://www.nutrient.io/api/react-native/NotificationCenter.html) class, which can be used to subscribe to viewer events. This includes events specifically related to a document.

## Registering for viewer events in the notification center

The example below shows how to register for an event listener to be notified when a document has loaded:

```js

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

```

## Unregistering from viewer events in the notification center

The example below shows how to unregister from document-loaded listener events:

```js

  override componentWillUnmount () {
    this.pdfRef.current?.getNotificationCenter().unsubscribe(NotificationCenter.DocumentEvent.LOADED);
  }

```

If you registered for multiple events and want to unregister from all of them, use the following API:

```js

  override componentWillUnmount () {
    this.pdfRef.current?.getNotificationCenter().unsubscribeAllEvents();
  }

```

For a list of all the viewer-related events you can register for, see [`DocumentEvent`](https://www.nutrient.io/api/react-native/NotificationCenter.html#.DocumentEvent) and [`TextEvent`](https://www.nutrient.io/api/react-native/NotificationCenter.html#.TextEvent). For more details and sample code, see the [`EventListeners.tsx` example](https://github.com/PSPDFKit/react-native/tree/master/samples/Catalog/examples/EventListeners.tsx) from the [Catalog example project](https://www.nutrient.io/guides/react-native/prebuilt-solutions/example-projects.md#pspdfkit-catalog).
---

## Related pages

- [Analytics events](/guides/react-native/events-and-notifications/analytics.md)
- [Annotation events and notifications](/guides/react-native/events-and-notifications/annotation.md)
- [PDF viewer events](/guides/react-native/events-and-notifications/events.md)
- [Events and notifications](/guides/react-native/events-and-notifications.md)
- [PDF form events and notifications](/guides/react-native/events-and-notifications/forms.md)

