For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/native-apps/device-features.md.

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.

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: a key in permissions, with the sentence iOS shows when the app asks. See Permissions.
  • 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.

FeatureWhat to add to angular.jsonPaid Apple team?Platforms
Audio recorder (LynxAudioRecorder)permissions.microphoneNoiOS, Android
Background audio (LynxAudioPlayer)"backgroundAudio": trueNoiOS, Android
Barcode scanner (LynxBarcodeScanner)permissions.cameraNoiOS, Android
Biometrics (LynxBiometrics, LynxSecureStorage's requireBiometrics)permissions.biometricsNoiOS, Android
Bluetooth LE (LynxBluetooth)permissions.bluetoothNoiOS, Android
Calendar events (LynxCalendar)"calendar": trueNoiOS 17+, Android
Camera photos (LynxImagePicker's source: 'camera')permissions.cameraNoiOS, Android
Contacts: read them all (LynxContacts.getAll())permissions.contactsNoiOS, Android
File picker (LynxFilePicker)"filePicker": trueNoiOS, Android
A folder in the Files app, for LynxFilePicker to save to"fileSharing": trueNoiOS
Geolocation (LynxGeolocation)permissions.locationNoiOS, Android
Geolocation in the background (watchPosition({ background }))"backgroundLocation": true, permissions.locationNoiOS, Android
Geolocation areas (LynxGeolocation.watchRegion(), always)permissions.locationAlways, permissions.locationNoiOS, Android
Motion sensors and compass (LynxMotion)"motion": trueNoiOS, Android
NFC tags (LynxNfc)permissions.nfcYesiOS, Android
Save to the photo library (LynxPhotoLibrary)permissions.savePhotosNoiOS, Android
Share target (LynxShareTarget)"shareTarget": { "mimeTypes": [...] }YesiOS, Android
Sign in with Apple (LynxAppleSignIn)"signInWithApple": trueYesiOS
Store review (LynxStoreReview)"storeReview": trueNoiOS, Android
Tracking (LynxTracking)permissions.trackingNoiOS, Android
Wi-Fi: join a network (LynxWifi's join(), leave())"wifi": { "join": true }YesiOS, Android 10+
Wi-Fi: read the network (LynxWifi's currentNetwork())"wifi": { "readCurrentNetwork": true }, permissions.locationYesiOS, 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.
  • Sign in with Apple on Android uses Apple's web flow 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.

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.

OptionWhat it addsGuide
deepLinkSchemesURL schemes that open the app, e.g. ["myapp"] for myapp:// linksOpen the app from a link
appLinkDomainsYour websites whose https:// links open the app, e.g. ["example.com"]Your website's links
canOpenURLSchemesOther apps' schemes that canOpenURL() may ask about, e.g. ["whatsapp"]Check before you link
shortcutsThings the app does, for Siri on iOS and the app icon's menu on AndroidAdd shortcuts for Siri and the app icon
nativePluginsYour own Swift and Kotlin: native modules and elementsAdd native code
  • deepLinkSchemes: the router follows each link to its route. On Android, include the callback scheme of a web sign-in.
  • 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.

Why some need a paid Apple team

Some features need an entitlement: a capability Apple lets an app use only when its signature says so. The build adds each one to the iOS app:

OptionCapability
permissions.nfcNFC Tag Reading
signInWithAppleSign in with Apple
shareTargetApp Groups
wifi.joinHotspot Configuration
wifi.readCurrentNetworkAccess WiFi Information
appLinkDomainsAssociated Domains

A free 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. 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 you build for that iPhone.
  • shareTarget adds a Share Extension to the iOS app. It hands each share to the app through an 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 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. To try a feature on a phone, run ng serve --platform.

The 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 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.