# expo-guided-access

> An Expo Module to check if a device is in guided access mode.

Latest version **0.1.0** (published 2023-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install expo-guided-access
pnpm add expo-guided-access
yarn add expo-guided-access
bun add expo-guided-access
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-09-19 |
| First published | 2023-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Kilian Finger |
| Maintainers | kiwikilian |
| Keywords | react-native, expo, iOS, Guided Access |

## Links

- npm: https://www.npmjs.com/package/expo-guided-access
- Repository: https://github.com/KiwiKilian/expo-guided-access
- Homepage: https://github.com/KiwiKilian/expo-guided-access#readme
- Issues: https://github.com/KiwiKilian/expo-guided-access/issues
- npm.io page: https://npm.io/package/expo-guided-access

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2023-09-19

## README

# Expo Guided Access

An Expo Module to check if a device is in guided access mode.

> [!IMPORTANT]  
> This package is **not** part of the Expo SDK. It will only work with [development builds](https://docs.expo.dev/develop/development-builds/introduction/) and **not** with Expo Go.

> [!NOTE]  
> Currently only iOS is supported.

## Installation

### Installation in Expo Projects with Development Builds

```
npm install expo-guided-access
```

As the module uses custom native code, create a new development build after installation.

### Installation in bare React Native Projects

For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.

#### Add the Package to your npm dependencies

```
npm install expo-guided-access
```

#### Configure for iOS

Run `npx pod-install` after installing the npm package.

## Usage

For applied usage see the [example app](example/App.tsx).

### Get Status

```tsx
const isGuidedAccessEnabled = await ExpoGuidedAccess.isGuidedAccessEnabled();
```

### Watch

```tsx
import * as ExpoGuidedAccess from 'expo-guided-access';
import { Subscription } from 'expo-modules-core';
import { useEffect, useState } from 'react';

// ...

const [guidedAccessEnabled, setGuidedAccessEnabled] = useState<boolean>();
const [subscription, setSubscription] = useState<Subscription>();

useEffect(() => {
  (async () => {
    const guidedAccessEnabled = await ExpoGuidedAccess.isGuidedAccessEnabled();
    setGuidedAccessEnabled(guidedAccessEnabled);

    setSubscription(
      ExpoGuidedAccess.addChangeListener(({ guidedAccessEnabled }) => {
        setGuidedAccessEnabled(guidedAccessEnabled);
      }),
    );
  })();

  return () => {
    subscription && subscription.remove();
    setSubscription(undefined);
  };
}, []);
```

---
_Source: https://npm.io/package/expo-guided-access · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
