Updated on 2023-03-23 GMT+08:00

Precautions

  1. You must register a proxy object to use a notification method.

    Single-proxy registration modes:

    1. Assign a value to the attribute of the HWMOpenSDKConfig object during initialization.
      1
      2
      3
      HWMOpenSDKConfig *config = [[HWMOpenSDKConfig alloc] init];
      // Example (Use the corresponding proxy as required.)
      config.confSettingHandler = [NotifyMessageHandler sharedInstance];
      
    2. Use [HWMSdk getSdkConfig] to obtain the initialization object and assign a value to the attribute.
      1
      2
      // Example (Use the corresponding proxy as required.)
      [HWMSdk getSdkConfig].confSettingHandler = [NotifyMessageHandler sharedInstance];
      

    Multi-proxy registration modes:

    1. Subscription
      1
      2
      3
      // Example (Use the corresponding proxy as required.)
      HWMOpenSDKConfig *config = [HWMSdk getSdkConfig].confSettingHandler;
      [config subscribeGlobalNotificationHandler:[NotifyMessageHandler sharedInstance]];
      
    2. Unsubscription
      1
      2
      3
      HWMOpenSDKConfig *config = [HWMSdk getSdkConfig].confSettingHandler;
      // Example (Use the corresponding proxy as required.)
      [config unsubscribeGlobalNotificationHandler:[NotifyMessageHandler sharedInstance]];
      
  2. The proxy method must be written in the proxy object.
  3. Ensure that the proxy object exists when using the proxy.