Interface CorePlugin

JS Bridge protocol definitions for Huawei HarmonyOS <-> Web communication.

Communication flow: Web -> Native: window.aigensHuawei.postMessage(JSON.stringify(BridgeRequest)) Native -> Web: window.aigensHuaweiCallback(callbackId, BridgeResponse) (success) window.aigensHuaweiError(callbackId, errorMessage) (failure)

interface CorePlugin {
    dismiss(options): Promise<any>;
    finish(options): Promise<any>;
    getDeeplink(options): Promise<{
        deeplink: Deeplink;
    }>;
    getMember(options): Promise<{
        member: Member;
    }>;
    isDebug(): Promise<{
        debug: boolean;
    }>;
    isHuawei(): Promise<{
        huawei: boolean;
    }>;
    isInstalledApp(options): Promise<{
        install: boolean;
    }>;
    makeHKFPSPayment(options): Promise<FPSResultOptions>;
    openExternalUrl(options): Promise<any>;
    readClipboard(): Promise<any>;
    setNativeBackPressEnabled(options): Promise<{
        enabled: boolean;
    }>;
    setNativeBackPressHandler(callback): void;
    setTextZoom(options): Promise<any>;
}

Implemented by

Methods

  • Parameters

    • options: any

    Returns Promise<any>

  • Parameters

    • options: any

    Returns Promise<any>

  • Parameters

    • options: any

    Returns Promise<{
        member: Member;
    }>

  • Returns Promise<{
        debug: boolean;
    }>

  • Returns Promise<{
        huawei: boolean;
    }>

  • Parameters

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

    Returns Promise<{
        install: boolean;
    }>

  • Parameters

    • options: {
          url: string;
      }
      • url: string

    Returns Promise<any>

  • Promise: { value: string, type: 'text/plain' }

    Returns Promise<any>

  • 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

        true or false

    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>