# 🍏 FleetFlow iOS Application & .IPA Guide

This directory contains the **Native iOS Xcode Project** (`ios/`), pre-packaged **`.IPA` archive** (`FleetFlow.ipa`), and **Automated GitHub Actions CI/CD** workflow for FleetFlow / Skylark Logistics.

---

## 📦 Project Structure

```
c:\wamp64\www\wep\
├── FleetFlow.ipa                # Pre-packaged iOS Application Archive (.IPA)
├── .github/workflows/
│   └── build_ios.yml            # Automated GitHub Actions workflow on macos-latest
└── ios/                         # Standalone Native iOS Xcode Project
    ├── FleetFlow.xcodeproj/     # Xcode Project file (Xcode 15+)
    │   └── project.pbxproj
    └── FleetFlow/
        ├── Info.plist           # Permissions (Camera, GPS Location, Photo Library)
        ├── AppDelegate.swift    # App Lifecycle
        ├── SceneDelegate.swift  # UI Window Management
        └── ViewController.swift # Production WKWebView + GPS Telematics & OCR Bridge
```

---

## 🚀 4 Ways to Install & Run on iPhone / iPad

### Method 1: Instant Direct Profile Install (`.mobileconfig`) — No PC, No App Store
This installs the FleetFlow application icon directly onto the iPhone Home Screen using Apple's official WebClip configuration profile:
1. On your iPhone, open Safari and visit:
   ```
   https://app.skylarklogistics.in/download.php
   ```
2. Tap the green button: **"Direct Install on iPhone (.mobileconfig)"** (or open `https://app.skylarklogistics.in/install-ios.php`).
3. When iOS prompts *"This website is trying to download a configuration profile. Do you want to allow this?"*, tap **Allow**.
4. Open the iPhone **Settings** app &rarr; Tap **"Profile Downloaded"** at the top.
5. Tap **"Install"** (top right) &rarr; enter your device passcode &rarr; tap **"Install"**.
6. **Done!** FleetFlow is now installed directly on your iPhone home screen!

---

### Method 2: Instant Safari 1-Tap Web App (Zero Setup)
1. Open **Safari** on iPhone and visit:
   ```
   https://app.skylarklogistics.in/
   ```
2. Tap the **Share icon** (`􀈂` / arrow pointing up out of a square) at the bottom toolbar.
3. Scroll down and tap **"Add to Home Screen"** (`+`).
4. Tap **Add** in top-right.
5. **Done!** The FleetFlow app icon will appear on your iOS Home Screen:
   - Launches in **full-screen standalone app mode** (no Safari URL bar).
   - Instant native **Camera access** for odometer & fuel receipt scanning.
   - High-precision **Live GPS Telematics** tracking.
   - Offline cache support.

---

### Method 2: Sideload `FleetFlow.ipa` via AltStore or Sideloadly (Windows PC or Mac)
To install the native `.ipa` directly onto any iPhone using a free Apple ID:
1. Download **[Sideloadly](https://sideloadly.io/)** (Free for Windows & Mac) or **AltStore**.
2. Connect your iPhone to your PC with a Lightning / USB-C cable.
3. Drag & drop `FleetFlow.ipa` into Sideloadly.
4. Enter your Apple ID and click **Start**.
5. Once installed, go to iPhone **Settings > General > VPN & Device Management** and trust your Developer profile.
6. Launch FleetFlow on your iPhone!

---

### Method 3: Build in Xcode on macOS (or Automated GitHub Actions)

#### A. In Xcode on Mac:
1. Open `ios/FleetFlow.xcodeproj` in Xcode.
2. Select your development team under **Signing & Capabilities**.
3. Choose your connected iPhone or an iOS Simulator.
4. Press **Cmd + R** to run, or **Product > Archive** to export signed `.ipa` for TestFlight / App Store.

#### B. Free Cloud Build via GitHub Actions:
The repository includes `.github/workflows/build_ios.yml`:
1. Push this repository to GitHub.
2. Go to the **Actions** tab on your GitHub repository.
3. The **"Build iOS IPA Package"** workflow will compile the project on an official Apple macOS runner and output the downloadable `.ipa` artifact!
