
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
react-native-pinned-mode
Advanced tools
react-native-pinned-mode is a React Native library that enables developers to easily configure and control Android’s Pinned Mode. With this package, you can lock your app to the foreground and prevent users from leaving the app unintentionally — making it
A lightweight React Native library that enables developers to easily configure and control Android’s Pinned Mode.
With this package, you can:
Lock your app to the foreground.
Prevent users from leaving the app unintentionally.
Ensure uninterrupted focus on a single app — ideal for kiosk-style flows, presentations, or restricted-use scenarios.
⚠️ Note: This package is Android only.
Pinned Mode (introduced in Android 5.0 Lollipop) allows you to lock your app to the foreground so users cannot switch to another app accidentally.
Unlike Kiosk Mode, Pinned Mode does not require device owner privileges or enterprise management tools.
Users can exit Pinned Mode with a specific key combination (usually Back + Overview/Recent Apps buttons).
This makes it lightweight and suitable for temporary focus locking, such as:
Payment terminals
Customer feedback apps
Single-task flows (like exams or demos)
Pinned Mode ensures the app stays in focus while still giving users a way to exit if needed — making it less restrictive than full Kiosk Mode.
npm install react-native-pinned-mode
import {
enablePinnedMode,
disablePinnedMode,
isPinnedModeActive,
} from 'react-native-pinned-mode';
const handlePinnedMode = async () => {
try {
const active = await isPinnedModeActive();
if (!active) {
await enablePinnedMode(); // Enable pinned mode
} else {
await disablePinnedMode(); // Disable pinned mode
}
} catch (e) {
console.log("Pinned Mode Error:", e);
}
};
When using Pinned Mode, apps are generally allowed on the Play Store because:
It is an official Android API.
Users always have a system-level way to exit.
✅ Best practices for publishing:
Clearly explain the use case in your app description if Pinned Mode is a core feature.
Avoid presenting it as "locking users" permanently — emphasize focus and security.
Ensure your app behaves gracefully when Pinned Mode is exited.
Pinned Mode is an Android-only feature. iOS does not provide an equivalent API in React Native.
However, iOS has:
Guided Access → A system-level feature that lets users lock the device to a single app. This is controlled by the device owner (via accessibility settings), not by the app.
MDM (Mobile Device Management) / Single App Mode → Enterprise-level solution to lock devices into a single app.
👉 Developers cannot enable Guided Access or Single App Mode programmatically from within an iOS app. For apps requiring similar restrictions on iOS, you’ll need to instruct users/admins to enable Guided Access or use MDM solutions.
Customer feedback apps in stores.
Payment terminals where accidental exits should be avoided.
Exam/test apps to prevent switching apps.
Single-purpose enterprise apps.
MIT
FAQs
react-native-pinned-mode is a React Native library that enables developers to easily configure and control Android’s Pinned Mode. With this package, you can lock your app to the foreground and prevent users from leaving the app unintentionally — making it
We found that react-native-pinned-mode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.