NotificationCenter()
new NotificationCenter()
The Notification Center for the Nutrient React Native SDK.
Members
(static, readonly) AnalyticsEvent :string
Analytics events.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
ANALYTICS |
string | Called when any analytics event has been triggered. |
(static, readonly) AnnotationsEvent :string
Annotation events.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
ADDED |
string | Called when one or more annotations have been added. |
CHANGED |
string | Called when an existing annotation has been changed. |
REMOVED |
string | Called when one or more annotations have been removed. |
SELECTED |
string | Called when one or more annotations have been selected. |
DESELECTED |
string | Called when one or more annotations have been deselected. |
TAPPED |
string | Called when a user taps on an annotation but before the SDK continues handling the touch in the annotationsSelected callback. |
(static, readonly) DocumentEvent :string
Document events.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
LOADED |
string | Called when the document has been loaded. |
LOAD_FAILED |
string | Called when the document failed to load. |
PAGE_CHANGED |
string | Called when the document page changed. |
(static, readonly) FormFieldEvent :string
FormField events.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
VALUES_UPDATED |
string | Called when form field values have changed. |
SELECTED |
string | Called when a form field has been selected. |
DESELECTED |
string | Called when a form field has been deselected. |
(static, readonly) TextEvent :string
Text Selection events.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
SELECTED |
string | Called when a text selection has been made. |
Methods
(static) subscribe(event, callback)
Subscribes to a given Notification Center event.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event to subscribe to. |
callback |
any | The callback to be called when the event is triggered. |
Example
this.pdfRef.current?.notificationCenter().subscribe('documentLoaded', (result) => {
console.log('Document Callback: ' + result);
});
(static) unsubscribe(event)
Unsubscribes from a given Notification Center event.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event to unsubscribe from. |
Example
this.pdfRef.current?.notificationCenter().unsubscribe('documentLoaded');
(static) unsubscribeAllEvents()
Unsubscribes from all Notification Center events.
Example
this.pdfRef.current?.notificationCenter().unsubscribeAllEvents();