Launches capacitor app in fullscreen (immersive) mode.
npm install @boengli/capacitor-fullscreenThis Capacitor plugin allows you to enable fullscreen mode in your Android app, hiding the system status and navigation bars for a more immersive experience.
The Fullscreen functionality utilizes WindowInsetsControllerCompat to manage immersive mode on Android.
- Plugin version 0.0.19 (Alpha/Testing)
🚧 This version is updated for Capacitor 7 but has not been fully tested yet.
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.
1. Install npm i @boengli/capacitor-fullscreen
2. In /android/variable.gradle make sure to have at least androidxCoreVersion >= 1.9.0
3. npx cap sync android
``
import { Fullscreen } from '@boengli/capacitor-fullscreen';
try {
await Fullscreen.activateImmersiveMode();
console.log('Fullscreen enabled');
} catch (error) {
console.error('Error enabling fullscreen:', error);
}
`
You don't need a plugin. Just add this to your Info.plist:
`xml`
`typescript`
activateImmersiveMode() => Promise
Activates immersive mode, hiding both the status and navigation bars.
| Param | Type | Description |
|-------|--------|-------------|
| N/A | N/A | This 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.
---
`typescript``
deactivateImmersiveMode() => Promise
Deactivates immersive mode, restoring visibility to the status and navigation bars.
| Param | Type | Description |
|-------|--------|-------------|
| N/A | N/A | This 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.