# missioflow-mobile

Mobile multi-tenant app for MissioFlow / CoolCare (Expo + React Native).

## Setup

```bash
npm install
npx expo start
```

## API configuration

Configure the API base URL with:

```bash
EXPO_PUBLIC_API_BASE_URL=https://your-domain/api/mobile
```

## Implemented flow

- Login (`/login.php`)
- Session check (`/me.php`)
- Refresh (`/refresh.php`) when access token is invalid
- Logout (`/logout.php`)
- Tokens stored with `expo-secure-store`

## Push notifications (Expo)

The app registers an Expo push token after login and on session restore
(`POST /mobile/register_device.php`). The backend notifies the assigned
technician immediately when an admin modifies one of their interventions
(reassignment, date change, cancellation, site/machine change) by calling the
Expo push API. On reception (foreground or tap), the app reloads the missions
list so the change is reflected right away.

> For standalone Android/iOS builds, Expo push delivery requires the project's
> FCM/APNs credentials to be configured in the Expo project (`eas credentials`).
> On a simulator/emulator no token is generated and registration is skipped.
