CoreHuawei implements the same CorePlugin interface as aigens-sdk-core, but routes all method calls through the Huawei JS Bridge to HarmonyOS native.

This class is used when isHuaWei() returns true (Huawei WebView detected via UA). It serves as a drop-in replacement for Capacitor's Core plugin object.

Implements

Constructors

Methods

  • Returns Promise<{
        debug: boolean;
    }>

  • Returns Promise<{
        huawei: boolean;
    }>

  • Parameters

    • options: {
          key: string;
      }
      • key: string

    Returns Promise<{
        install: boolean;
    }>

  • Enable or disable native back press handling. When false, system back (swipe, button) is completely ignored while the WebView is open. DISMISS still works programmatically. After the WebView is dismissed, the host app's normal back behavior is automatically restored. When true (default), back press navigates WebView back, or dismisses if no history.

    Parameters

    • options: {
          enable: boolean;
      }
      • enable: boolean

    Returns Promise<{
        enabled: boolean;
    }>

  • Register a callback invoked when a native back press occurs. Only effective when NativeBackPressEnabled = true. If NativeBackPressEnabled = false, a warning is logged to console.

    Parameters

    • callback: (() => void)

      Called on back press (swipe, button, etc.)

        • (): void
        • Returns void

    Returns void

  • Parameters

    • options: {
          value: number;
      }
      • value: number

    Returns Promise<any>