Class PreferencesHuawei

PreferencesHuawei implements the same PreferencesPlugin interface as @capacitor/preferences, routing calls through the Huawei JS Bridge.

Data is stored in HarmonyOS native preferences storage, which is persistent and not subject to the periodic localStorage clears the OS may perform on WebViews. Stored data is cleared when the app is uninstalled.

The group from configure() maps to the native preferences store name (default 'CapacitorStorage'), mirroring how the Android implementation maps group -> SharedPreferences.

Implements

Constructors

Methods

  • Set a value. Note: the native side removes the key when the value is empty (cookie-like semantics) instead of storing an empty string.

    Parameters

    Returns Promise<void>