# האפליקציה הנייטיבית

> תיעוד מקור. מקור: apps/mobile/README.md · 6a466bf.

Native iOS/Android client foundation built with Expo + React Native.

## Boundaries

- This app is not a WebView of the existing Next.js product.
- Approved LinkNodes visual tokens are copied from the current Visual System.
- Clerk owns identity; Supabase RLS remains the authorization boundary.
- Only publishable client keys may use the EXPO_PUBLIC\_ prefix.
- SUPABASE_SERVICE_ROLE_KEY, payment secrets and provider credentials must never enter the mobile bundle.
- The approved app icon source is assets/linknodes-icon.svg. Native store icon renditions are generated and verified during the signing/release phase.

## Current checks

CI installs the shared frozen workspace lockfile, typechecks the mobile app, runs foreground-map and workspace-isolation regressions, runs Expo Doctor, and exports both iOS and Android JavaScript bundles.

Native signed device builds and store submissions are later explicit release gates.

## Native map release notes

- Opening the map resolves a fresh foreground location before mounting the initial map and fetching stations. A denied or unavailable fix retains manual map navigation.
- The device position uses the selected vehicle's existing approved image. A single active vehicle is selected automatically; multiple vehicles require an explicit choice. Approved images use a fixed product origin and contain sizing without cropping. Missing imagery uses the existing car symbol.
- The foreground watcher updates the marker without repeatedly moving the camera. Leaving the map or backgrounding the app removes the watch and marker; reentry obtains a fresh fix. A marker older than one minute is retired. Explicit Locate recenters; automatic foreground refresh preserves a manually panned viewport.
- Requests and vehicle choices are scoped to the signed-in user and active tenant. Late viewport or account-context responses are invalidated, and Clerk token access stays current without restarting effects on each render.
- Foreground location only. No background location permission is requested.
- The exact device location is not written to LinkNodes APIs; the map API receives only viewport bounds.
- iOS uses the native Apple Maps provider through react-native-maps.
- Android standalone builds require a Google Maps SDK API key restricted to `com.linknodesenergy.app` and the production signing certificate. Do not commit unrestricted keys.

Run the focused local regressions with `pnpm --filter @linknodes/mobile run test:map`. A successful Metro export is a JavaScript-bundle check; an installable IPA/APK still requires Expo authentication, signing configuration, client environment verification and device testing.
