unsubscribe(id)
Removes the handler from its subscriptions and disconnects the web socket from the messaging service.
Returns
Not applicable.
Parameters
Name | Type | Description | Required |
id | string | The unique identifier of the subscription from which the handler must be removed. | ✅ |
Usage example
In this example, the API removes the handler from its subscriptions and disconnects the web socket from the messaging service.
const subId = PCore.getMessagingServiceManager().subscribe({matcher: "interaction"}, message => {
// Perform message execution here
}));
PCore.getMessagingServiceManager().unsubscribe(subId);
Previous topic subscribe(filter, messageHandler, id, contextName) Next topic APIs in the NavigationUtils class