Unsubscribe from Dynamic Common Events

Note:

Currently in the beta phase.

Scenario Description

After completing business requirements, dynamic subscribers should proactively unsubscribe. Call the unsubscribe() method to cancel event subscriptions.

Interface Description

Interface Name Description
unsubscribe(subscriber: CommonEventSubscriber): Unit Unsubscribes from common events.

Development Steps

  1. Import the module.

    import kit.BasicServicesKit.*
    
  2. Follow the steps in the Dynamic Common Event Subscription section to subscribe to an event.

  3. Call the unsubscribe() method in CommonEvent to unsubscribe from an event.

    // subscriber is the subscriber object created during event subscription
     CommonEventManager.unsubscribe(subscriber)