Files
timetracker/ios/TimeTracker
Simon Franken 461405c418 Fix iOS timer widget not displaying active timers
The widget was failing to decode the cached timer data because WidgetTimer
struct didn't match the OngoingTimer JSON structure saved by the app.

Changes:
- Added missing fields (project, createdAt, updatedAt) to WidgetTimer
- Added WidgetProjectReference struct for nested project data
- Fixed project name to use project.name instead of projectId
- Added project color support
- Increased refresh interval from 15 min to 1 min for live updates
2026-02-20 15:49:35 +01:00
..
2026-02-18 21:45:09 +01:00
2026-02-18 21:35:32 +01:00
2026-02-18 21:35:32 +01:00

TimeTracker iOS App

Setup Instructions

Prerequisites

  1. XcodeGen - Required to generate the Xcode project

    # On macOS:
    brew install xcodegen
    
    # Or via npm:
    npm install -g xcodegen
    
  2. Xcode - For building the iOS app (macOS only)

Project Generation

After installing XcodeGen, generate the project:

cd ios/TimeTracker
xcodegen generate

This will create TimeTracker.xcodeproj in the ios/TimeTracker directory.

Configuration

Before building, configure the API base URL:

  1. Open TimeTracker.xcodeproj in Xcode
  2. Select the TimeTracker target
  3. Go to Info.plist
  4. Add or modify API_BASE_URL with your backend URL:
    • For development: http://localhost:3001
    • For production: Your actual API URL

Building

Open the project in Xcode and build:

open ios/TimeTracker/TimeTracker.xcodeproj

Then select your target device/simulator and press Cmd+B to build.

Authentication Setup

  1. Configure your OIDC provider settings in the backend
  2. The iOS app uses ASWebAuthenticationSession for OAuth
  3. The callback URL scheme is timetracker://oauth/callback

App Groups

For the widget to work with the main app, configure the App Group:

  • Identifier: group.com.timetracker.app
  • This is already configured in the project.yml

Dependencies

The project uses Swift Package Manager for dependencies:

Project Structure

TimeTracker/
├── TimeTrackerApp/          # App entry point
├── Core/
│   ├── Network/             # API client
│   ├── Auth/               # Authentication
│   └── Persistence/        # SQLite + sync
├── Features/
│   ├── Auth/              # Login
│   ├── Timer/              # Timer (core feature)
│   ├── TimeEntries/       # Time entries CRUD
│   ├── Projects/          # Projects CRUD
│   ├── Clients/           # Clients CRUD
│   └── Dashboard/         # Dashboard
├── Models/                  # Data models
├── Shared/                  # Extensions & components
└── Resources/              # Assets

TimeTrackerWidget/           # iOS Widget Extension