https://github.com/markrickert/expo-required-hardware
An expo config plugin to specify necessary hardware for running your app.
https://github.com/markrickert/expo-required-hardware
Last synced: 10 months ago
JSON representation
An expo config plugin to specify necessary hardware for running your app.
- Host: GitHub
- URL: https://github.com/markrickert/expo-required-hardware
- Owner: markrickert
- License: mit
- Created: 2024-08-12T02:12:27.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T14:04:49.000Z (almost 2 years ago)
- Last Synced: 2025-08-21T04:06:55.060Z (10 months ago)
- Language: JavaScript
- Size: 153 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expo-required-hardware
> This Expo plugin allows you to specify hardware requirements for your app. It is useful for apps that require specific hardware features to function properly like a front-facing camera, GPS, or Bluetooth.
## Overview
This plugin provides an easy interface to specify hardware requirements for your app. It does this during the expo `prebuild` phase and will modify your `AndroidManifest.xml` and `Info.plist` files to include the necessary hardware features.
Note that this config plugin may restrict the types and number of devices that your app can be installed on. For example, if you require a front-facing camera, your app will not be installable on devices that do not have a front-facing camera. This will be restricted at the appstore level due to the entries that this plugin helps specify in the `AndroidManifest.xml` and `Info.plist` files.
---
## Install
```sh
npx expo install expo-required-hardware
# npm
npm install expo-required-hardware
# yarn
yarn add expo-required-hardware
```
## Usage in app.json / app.config.js
Add the plugin declaration anywhere in your app's plugin array:
```json
{
"plugins": [
[
"expo-required-hardware",
{
// This app can only be installed on devices that have NFC and a gyroscope
"ios": [
"nfc",
"gyroscope"
],
"android": [
"android.hardware.nfc",
"android.hardware.sensor.gyroscope"
]
}
],
]
}
```
You can find a list of all available hardware features for Android and iOS in their respective files in this repo:
- [Android Hardware Features](./src/valid-features/android.ts)
- [iOS Hardware Features](./src/valid-features/ios.ts)