App Native Capabilities
When to use
During phase 4, after the shell exists, when the web app uses a feature that needs native access, plus the baseline mobile UX plugins.
Inputs
- Features the web app uses (file upload, camera input, geolocation, notifications, downloads), target.
Procedure: Capacitor (inside os/<target>)
- Baseline:
npm install @capacitor/app @capacitor/status-bar @capacitor/keyboard @capacitor/splash-screen.
- Back button:
App.addListener("backButton", ({ canGoBack }) => canGoBack ? history.back() : App.exitApp()).
- Only when used:
@capacitor/camera, @capacitor/filesystem, @capacitor/preferences, @capacitor/push-notifications (needs google-services.json from the user, never committed if private), @capacitor/geolocation.
- Permissions in
android/app/src/main/AndroidManifest.xml only for used plugins (CAMERA, ACCESS_FINE_LOCATION, POST_NOTIFICATIONS); iOS Info.plist usage strings (NSCameraUsageDescription, ...). Request at the moment of use, never at startup.
npx cap sync android.
Procedure: Tauri (inside os/<target>)
npx tauri add <plugin> for fs, dialog, notification, shell, updater, store.
src-tauri/capabilities/default.json: list exact permissions, for example "fs:allow-read-text-file" with a scope [{ "path": "$APPDATA/**" }], never fs:default over $HOME/**.
- Shell: only
shell:allow-open or a scoped sidecar { "identifier": "shell:allow-execute", "allow": [{ "name": "binaries/<sidecar>", "sidecar": true }] }.
- Updater: endpoint HTTPS,
pubkey in config, private key from env (app-release-manager).
Verification
Each plugin call exercised in a device or desktop test; permission list reviewed by app-security-auditor.
Failure modes and fixes
- Plugin not implemented on web: guard with
Capacitor.isNativePlatform().
- Tauri
not allowed error: permission missing from the capability file.
Deliverable
Plugin list with the permissions each one adds; report step native.
1---2name: app-native-capabilities3description: App Factory native features. Add only the native capabilities the app really uses - Capacitor plugins (Camera, Filesystem, Preferences, Push Notifications, Geolocation, App back button, StatusBar, Keyboard, SplashScreen) and Tauri 2 plugins (fs, dialog, notification, shell with scope, updater, store) - always with minimal permissions.4metadata:5 source: https://skillmd.com/skills/navinspire-ia/app-native-capabilities6 navin:7 emoji: 📲8 category: development9---1011# App Native Capabilities1213## When to use1415During phase 4, after the shell exists, when the web app uses a feature that needs native access, plus the baseline mobile UX plugins.1617## Inputs1819- Features the web app uses (file upload, camera input, geolocation, notifications, downloads), target.2021## Procedure: Capacitor (inside `os/<target>`)22231. Baseline: `npm install @capacitor/app @capacitor/status-bar @capacitor/keyboard @capacitor/splash-screen`.242. Back button: `App.addListener("backButton", ({ canGoBack }) => canGoBack ? history.back() : App.exitApp())`.253. Only when used: `@capacitor/camera`, `@capacitor/filesystem`, `@capacitor/preferences`, `@capacitor/push-notifications` (needs `google-services.json` from the user, never committed if private), `@capacitor/geolocation`.264. Permissions in `android/app/src/main/AndroidManifest.xml` only for used plugins (`CAMERA`, `ACCESS_FINE_LOCATION`, `POST_NOTIFICATIONS`); iOS `Info.plist` usage strings (`NSCameraUsageDescription`, ...). Request at the moment of use, never at startup.275. `npx cap sync android`.2829## Procedure: Tauri (inside `os/<target>`)30311. `npx tauri add <plugin>` for `fs`, `dialog`, `notification`, `shell`, `updater`, `store`.322. `src-tauri/capabilities/default.json`: list exact permissions, for example `"fs:allow-read-text-file"` with a scope `[{ "path": "$APPDATA/**" }]`, never `fs:default` over `$HOME/**`.333. Shell: only `shell:allow-open` or a scoped sidecar `{ "identifier": "shell:allow-execute", "allow": [{ "name": "binaries/<sidecar>", "sidecar": true }] }`.344. Updater: endpoint HTTPS, `pubkey` in config, private key from env (`app-release-manager`).3536## Verification3738Each plugin call exercised in a device or desktop test; permission list reviewed by `app-security-auditor`.3940## Failure modes and fixes4142- Plugin not implemented on web: guard with `Capacitor.isNativePlatform()`.43- Tauri `not allowed` error: permission missing from the capability file.4445## Deliverable4647Plugin list with the permissions each one adds; report step `native`.