@boengli/capacitor-fullscreen

中文文档
0.0.20发布于 2026/05/29MITTypeScriptESM + CJS零依赖近 30 天下载 3296

Launches capacitor app in fullscreen (immersive) mode.

原始使用文档
文档目录9 节
  1. Details
  2. Compatibility
  3. Installation
  4. Configuration
  5. Example Usage
  6. iOS
  7. Function Descriptions
  8. activateImmersiveMode
  9. deactivateImmersiveMode

@boengli/capacitor-fullscreen

This Capacitor plugin allows you to enable fullscreen mode in your Android app, hiding the system status and navigation bars for a more immersive experience.

Details

The Fullscreen functionality utilizes WindowInsetsControllerCompat to manage immersive mode on Android.

Compatibility

  • Plugin version 0.0.20
    This version is updated for Capacitor 8.
    Requires Android 7.0 (API 24) and above and Java 21.

  • Plugin version 0.0.19
    This version is updated for Capacitor 7.
    Requires Android 11.0 (API 30) and above and Java 21.

  • Plugin version 0.0.18
    Support is now streamlined for Android 11.0 (API 30) and above. Legacy support for earlier Android versions has been dropped.

  • Plugin version 0.0.17
    The immersive mode implementation supports Android 8.0 (API 26) and above.

Installation

  1. Install npm i @boengli/capacitor-fullscreen
  2. If your app overrides androidxCoreVersion in /android/variables.gradle, make sure it is >= 1.17.0
  3. npx cap sync android

Configuration

In your capacitor.config.ts:

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  plugins: {
    Fullscreen: {
      activateOnLoad: true, // default — activates immersive mode as soon as the plugin loads
    },
  },
};

Set activateOnLoad: false if you want to control fullscreen manually and only call activateImmersiveMode() from your own code (e.g. on a specific page or user action).

Example Usage

import { Fullscreen } from '@boengli/capacitor-fullscreen';

try {
  await Fullscreen.activateImmersiveMode();
  console.log('Fullscreen enabled');
} catch (error) {
  console.error('Error enabling fullscreen:', error);
}

iOS

You don't need a plugin. Just add this to your Info.plist:

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>



Function Descriptions

activateImmersiveMode

activateImmersiveMode() => Promise<void>

Activates immersive mode, hiding both the status and navigation bars.

ParamTypeDescription
N/AN/AThis function does not take any parameters.

Returns: A Promise that resolves when immersive mode is successfully activated or rejects with an error if it fails.


deactivateImmersiveMode

deactivateImmersiveMode() => Promise<void>

Deactivates immersive mode, restoring visibility to the status and navigation bars.

ParamTypeDescription
N/AN/AThis function does not take any parameters.

Returns: A Promise that resolves when immersive mode is successfully deactivated or rejects with an error if it fails.

版本与发布记录

@boengli/capacitor-fullscreen 共发布 25 个版本,首次发布于 2024/11/04;过去 12 个月发布了 6 个版本。

版本发布日期距今
0.0.20latest2026/05/295 个月前
0.0.20-beta.3beta2026/05/265 个月前
0.0.20-beta.22026/05/086 个月前
0.0.20-beta.12026/04/156 个月前
0.0.20-beta.02026/04/156 个月前
0.0.20-alpha.0alpha2026/03/257 个月前

关于 @boengli/capacitor-fullscreen 的常见问题

@boengli/capacitor-fullscreen 是什么?

Launches capacitor app in fullscreen (immersive) mode.

如何安装 @boengli/capacitor-fullscreen?

在项目目录运行 npm install @boengli/capacitor-fullscreen,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@boengli/capacitor-fullscreen 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@boengli/capacitor-fullscreen 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@boengli/capacitor-fullscreen 可以商用吗?

@boengli/capacitor-fullscreen 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@boengli/capacitor-fullscreen 的下载量有多少?

根据 npm 官方下载统计,@boengli/capacitor-fullscreen 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,296 次,日均约 110 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@boengli/capacitor-fullscreen 还在维护吗?

最新版本 0.0.20 发布于 2026/05/29(5 个月前);至今共发布 25 个版本,其中过去 12 个月发布了 6 个;首次发布于 2024/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。