> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Turn on device features

**Most device features are off until you add one setting to angular.json.** Bluetooth, NFC, the camera, the calendar and the rest each bring native code, and often a permission. The build leaves out every feature you don't turn on, so your app ships only the native code and permissions it uses.

```json title="angular.json"
"build": {
  "builder": "@blotch/angular-lynx-build:application",
  "options": {
    "permissions": {
      "camera": "Scans your ticket",
      "bluetooth": "Connects to your picture frame"
    },
    "calendar": true
  }
}
```

This turns on the barcode scanner, the image picker's camera, Bluetooth and the calendar. Run `ng build --platform` or `ng serve --platform` again to get them: a change to these options rebuilds the native app.

There are two kinds of setting:

- **A [permission reason](/guide/glossary.md#permission-reason):** a key in `permissions`, with the sentence iOS shows when the app asks. See [Permissions](/guide/native-apps/permissions.md).
- **A switch:** `true`, or an object for a feature with parts. These features ask for no permission, except reading the Wi-Fi network's name, which needs the location.

## Every opt-in feature

In this table, `permissions.camera` means a `camera` key in `permissions`, with its reason.

| Feature                                                                                                                                         | What to add to angular.json                                      | Paid Apple team? | Platforms        |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------- | ---------------- |
| [Audio recorder](/api/angular-lynx/hardware/audio-recorder.md#turn-it-on) (`LynxAudioRecorder`)                                                 | `permissions.microphone`                                         | No               | iOS, Android     |
| [Background audio](/api/angular-lynx/hardware/audio-player.md#play-in-the-background) (`LynxAudioPlayer`)                                       | `"backgroundAudio": true`                                        | No               | iOS, Android     |
| [Barcode scanner](/api/angular-lynx/hardware/barcode-scanner.md#turn-it-on) (`LynxBarcodeScanner`)                                              | `permissions.camera`                                             | No               | iOS, Android     |
| [Biometrics](/api/angular-lynx/hardware/biometrics.md#turn-it-on) (`LynxBiometrics`, `LynxSecureStorage`'s `requireBiometrics`)                 | `permissions.biometrics`                                         | No               | iOS, Android     |
| [Bluetooth LE](/api/angular-lynx/hardware/bluetooth.md#turn-it-on) (`LynxBluetooth`)                                                            | `permissions.bluetooth`                                          | No               | iOS, Android     |
| [Calendar events](/api/angular-lynx/media/calendar.md#turn-it-on) (`LynxCalendar`)                                                              | `"calendar": true`                                               | No               | iOS 17+, Android |
| [Camera photos](/api/angular-lynx/media/image-picker.md#turn-it-on) (`LynxImagePicker`'s `source: 'camera'`)                                    | `permissions.camera`                                             | No               | iOS, Android     |
| [Contacts: read them all](/api/angular-lynx/media/contacts.md#turn-it-on) (`LynxContacts.getAll()`)                                             | `permissions.contacts`                                           | No               | iOS, Android     |
| [File picker](/api/angular-lynx/media/file-picker.md#turn-it-on) (`LynxFilePicker`)                                                             | `"filePicker": true`                                             | No               | iOS, Android     |
| [A folder in the Files app](/api/angular-lynx/media/file-picker.md#turn-it-on), for `LynxFilePicker` to save to                                 | `"fileSharing": true`                                            | No               | iOS              |
| [Geolocation](/api/angular-lynx/hardware/geolocation.md#turn-it-on) (`LynxGeolocation`)                                                         | `permissions.location`                                           | No               | iOS, Android     |
| [Geolocation in the background](/api/angular-lynx/hardware/geolocation.md#follow-the-phone-in-the-background) (`watchPosition({ background })`) | `"backgroundLocation": true`, `permissions.location`             | No               | iOS, Android     |
| [Geolocation areas](/api/angular-lynx/hardware/geolocation.md#hear-when-the-phone-enters-an-area) (`LynxGeolocation.watchRegion()`, `always`)   | `permissions.locationAlways`, `permissions.location`             | No               | iOS, Android     |
| [Motion sensors and compass](/api/angular-lynx/hardware/motion.md#turn-it-on) (`LynxMotion`)                                                    | `"motion": true`                                                 | No               | iOS, Android     |
| [NFC tags](/api/angular-lynx/hardware/nfc.md#turn-it-on) (`LynxNfc`)                                                                            | `permissions.nfc`                                                | Yes              | iOS, Android     |
| [Save to the photo library](/api/angular-lynx/media/photo-library.md#turn-it-on) (`LynxPhotoLibrary`)                                           | `permissions.savePhotos`                                         | No               | iOS, Android     |
| [Share target](/api/angular-lynx/sharing/share-target.md#turn-it-on) (`LynxShareTarget`)                                                        | `"shareTarget": { "mimeTypes": [...] }`                          | Yes              | iOS, Android     |
| [Sign in with Apple](/api/angular-lynx/accounts/apple-sign-in.md#turn-it-on) (`LynxAppleSignIn`)                                                | `"signInWithApple": true`                                        | Yes              | iOS              |
| [Store review](/api/angular-lynx/accounts/store-review.md#turn-it-on) (`LynxStoreReview`)                                                       | `"storeReview": true`                                            | No               | iOS, Android     |
| [Tracking](/api/angular-lynx/accounts/tracking.md#turn-it-on) (`LynxTracking`)                                                                  | `permissions.tracking`                                           | No               | iOS, Android     |
| [Wi-Fi: join a network](/api/angular-lynx/hardware/wifi.md#turn-it-on) (`LynxWifi`'s `join()`, `leave()`)                                       | `"wifi": { "join": true }`                                       | Yes              | iOS, Android 10+ |
| [Wi-Fi: read the network](/api/angular-lynx/hardware/wifi.md#turn-it-on) (`LynxWifi`'s `currentNetwork()`)                                      | `"wifi": { "readCurrentNetwork": true }`, `permissions.location` | Yes              | iOS, Android     |

- **Some settings turn on two features.** `permissions.camera` turns on both the barcode scanner and the image picker's camera.
- **Picking needs no setting.** Every app has `LynxContacts.pick()` and the image picker's photo library.
- **Every other device API is in every app** `--platform` builds, such as `LynxHaptics`, `LynxClipboard` and `LynxShare`.
- **Three `permissions` keys turn on no feature:** `photos`, `notifications` and `localNetwork` only declare a permission. See [Permissions](/guide/native-apps/permissions.md#every-key).
- **Sign in with Apple on Android** uses Apple's [web flow](/guide/web-sign-in.md) instead.
- **`<canvas>` and WebGL follow your code,** with no setting. The build leaves them out of an app that never draws. See [What the build includes](/guide/canvas/index.md#what-the-build-includes).

## Links and shortcuts

These options let other apps, websites and Siri reach your app, or add your own native code. They turn on no API of their own.

| Option              | What it adds                                                               | Guide                                                                              |
| ------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `deepLinkSchemes`   | URL schemes that open the app, e.g. `["myapp"]` for `myapp://` links       | [Open the app from a link](/guide/deep-links.md)                                   |
| `appLinkDomains`    | Your websites whose `https://` links open the app, e.g. `["example.com"]`  | [Your website's links](/guide/deep-links.md#open-the-app-from-your-websites-links) |
| `canOpenURLSchemes` | Other apps' schemes that `canOpenURL()` may ask about, e.g. `["whatsapp"]` | [Check before you link](/guide/open-links.md#check-before-you-link)                |
| `shortcuts`         | Things the app does, for Siri on iOS and the app icon's menu on Android    | [Add shortcuts for Siri and the app icon](/guide/shortcuts.md)                     |
| `nativePlugins`     | Your own Swift and Kotlin: native modules and elements                     | [Add native code](/guide/native-plugins/index.md)                                  |

- **`deepLinkSchemes`:** the router follows each link to its route. On Android, include the callback scheme of a [web sign-in](/guide/web-sign-in.md).
- **`appLinkDomains`:** iOS needs `ios.teamId` with a paid team, and each site serves the file the build writes.
- **`canOpenURLSchemes`:** iOS and Android 11+ say no for any scheme the app doesn't declare. `http`, `https`, `mailto`, `tel` and `sms` are always there.
- **`shortcuts`:** each has an `id`, a `title` and Siri `phrases`.

## Without the setting

The build leaves the feature's native code out of both apps. Your code still compiles and runs, but the API can't reach the phone:

- **Most calls reject with `unavailable`,** such as `LynxCalendar.addEvent()` and `LynxBarcodeScanner.scan()`.
- **`LynxNfc` and `LynxAppleSignIn` reject with `unsupported`.**
- **Status signals read `unsupported`:** `state()` for Bluetooth and geolocation, `permission()` for contacts, `addPermission()` for the photo library and `status()` for tracking.
- **Availability checks find nothing.** `LynxBiometrics.availability()` reports `none`, and `LynxMotion.availability()` lists no sensors.
- **Some do nothing.** `LynxStoreReview.request()` resolves without showing anything, and `LynxShareTarget` never receives a share.
- **`backgroundAudio` leaves nothing out.** `LynxAudioPlayer` is in every app and plays while the app is on the screen; without the setting, it pauses when the app leaves.
- **`backgroundLocation` and `permissions.locationAlways` leave out only what they add.** With `permissions.location` alone, `LynxGeolocation` finds the phone while the app is in use; a background watch, `requestPermission({ always: true })` and `watchRegion()` reject with `unavailable`.

Some features bring a library too, which stays out with them. The barcode scanner brings Google Play services' code scanner, `storeReview` Google Play's review library, and `tracking` Google Play's advertising ID library.

Leaving code out is on purpose. App Store Connect flags an app whose code uses the camera, the location or Bluetooth without saying why. See [Permissions](/guide/native-apps/permissions.md#where-ios-shows-it).

## Why some need a paid Apple team

Some features need an [**entitlement**](/guide/glossary.md#entitlement): a capability Apple lets an app use only when its signature says so. The build adds each one to the iOS app:

| Option                    | Capability              |
| ------------------------- | ----------------------- |
| `permissions.nfc`         | NFC Tag Reading         |
| `signInWithApple`         | Sign in with Apple      |
| `shareTarget`             | App Groups              |
| `wifi.join`               | Hotspot Configuration   |
| `wifi.readCurrentNetwork` | Access WiFi Information |
| `appLinkDomains`          | Associated Domains      |

A free [Personal Team](/guide/glossary.md#personal-team) can't sign them. To run the app on an iPhone, set `ios.teamId` to a team in the paid [Apple Developer Program](https://developer.apple.com/programs/). Otherwise the build stops and names the option it can't sign.

- **The iOS Simulator needs no team.** It has no NFC reader, though.
- **Or leave the feature out** of the [configuration](/guide/native-apps/app-identity.md#per-environment-values) you build for that iPhone.
- **`shareTarget` adds a [Share Extension](/guide/glossary.md#share-extension)** to the iOS app. It hands each share to the app through an [App Group](/guide/glossary.md#app-group), the capability that needs the paid team.
- **Android has no entitlements.** These features need no paid account there.

## Lynx Explorer and the web preview

These settings only change the apps `--platform` builds, with `ng build` or `ng serve`.

**[Lynx Explorer](/guide/glossary.md#lynx-explorer) has none of these features.** It isn't your app, so your native code isn't in it. Calls there behave as [without the setting](#without-the-setting). To try a feature on a phone, run [`ng serve --platform`](/guide/native-apps/devices.md#develop-in-the-real-app-with-ng-serve).

**The [web preview](/guide/glossary.md#web-preview) ignores these settings.** It uses the browser's own API where there is one:

- `LynxGeolocation` uses `navigator.geolocation`.
- `LynxMotion` uses the page's `devicemotion` and `deviceorientation` events.
- `LynxAudioRecorder` uses the browser's `MediaRecorder`.
- `LynxAudioPlayer` plays in an `<audio>` element, with `navigator.mediaSession`. It plays in every app, `backgroundAudio` or not.
- `LynxImagePicker` and `LynxFilePicker` use an `<input type="file">`.
- `LynxCalendar` downloads an `.ics` file, and `LynxPhotoLibrary` downloads the file it saves.
- `LynxContacts.pick()` uses the Contact Picker API, which only Chrome on Android has.

The others, such as Bluetooth, NFC, Wi-Fi and the barcode scanner, aren't there. Each API page's platform table says what it does in the web preview.

## Ejected apps

[Ejecting](/guide/native-apps/eject.md) writes the native projects with the features that are on at that moment. After that, these settings stop applying:

- **A feature that was on stays,** with its permissions, until you take them out of the native projects.
- **A feature that was off is missing.** Adding it later is a native change, such as Bluetooth in a project ejected without `bluetooth`.

## Related

- [Permissions](/guide/native-apps/permissions.md)
- [Native app options](/api/build/index.md#native-app-options)
- [Add native code](/guide/native-plugins/index.md)
- [Publish to the app stores](/guide/publishing.md)
