wails/v3/IOS_RUNTIME.md
Lea Anthony 873848a077 Merge iOS support from v3-alpha-feature/ios-support
This commit integrates iOS platform support for Wails v3, adapting the
iOS-specific code to work with the new transport layer architecture.

Key changes:
- Add iOS-specific application, webview, and runtime files
- Add iOS event types and processing
- Add iOS examples and templates
- Update messageprocessor to handle iOS requests
- Move badge_ios.go to dock package

Note: The iOS branch was based on an older v3-alpha and required
significant conflict resolution due to the transport layer refactor
(PR #4702). Some iOS-specific code may need further adaptation:
- processIOSMethod needs to be implemented with new RuntimeRequest signature
- iOS event generation in tasks/events/generate.go needs updating

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 18:34:21 +11:00

2.3 KiB

iOS Runtime Feature Plan

This document outlines proposed iOS-only runtime features for Wails v3, the initial milestones, and method shapes exposed to the frontend runtime as IOS.*.

Goals

  • Provide a first-class iOS runtime namespace: IOS.
  • Expose UX-critical features with a small, well-defined, promise-based API.
  • Follow the existing runtime pattern: JS -> /wails/runtime -> Go -> ObjC.

Object: IOS

  • Object ID: 11 (reserved in runtime objectNames)

Milestone 1 (MVP)

  • Haptics
    • IOS.Haptics.Impact(style: "light"|"medium"|"heavy"|"soft"|"rigid"): Promise<void>
  • Device
    • IOS.Device.Info(): Promise<{ model: string; systemName: string; systemVersion: string; isSimulator: boolean }>

Milestone 2

  • Permissions
    • IOS.Permissions.Request("camera"|"microphone"|"photos"|"notifications"): Promise<"granted"|"denied"|"limited">
    • IOS.Permissions.Status(kind): Promise<"granted"|"denied"|"limited"|"restricted"|"not_determined">
  • Camera
    • IOS.Camera.PickPhoto(options?): Promise<{ uri: string }>
    • IOS.Camera.PickVideo(options?): Promise<{ uri: string, duration?: number }>
  • Photos
    • IOS.Photos.SaveImage(dataURL|blob, options?): Promise<void>
    • IOS.Photos.SaveVideo(fileURI, options?): Promise<void>

Milestone 3

  • Share
    • IOS.Share.Sheet({ text?, url?, imageDataURL? }): Promise<void>
  • Files
    • IOS.Files.Pick({ types?, multiple? }): Promise<Array<{ uri: string, name: string, size?: number }>>
  • Biometric
    • IOS.Biometric.CanAuthenticate(): Promise<boolean>
    • IOS.Biometric.Authenticate(reason: string): Promise<boolean>
  • Notifications
    • IOS.Notifications.RequestPermission(): Promise<boolean>
    • IOS.Notifications.Schedule(localNotification): Promise<string /* id */>

Notes

  • All APIs should be safe no-ops on other platforms (reject with a meaningful error) or be tree-shaken by frontend bundlers.
  • UI-affecting APIs must ensure main-thread execution in ObjC.
  • File/Photo APIs will use security-scoped bookmarks where relevant.

Implementation Status

  • Define plan (this document)
  • JS runtime: add IOS object ID + IOS module exports
  • Go: message dispatcher for IOS object
  • iOS: Haptics.Impact(style) native bridge
  • JS->Go->ObjC wiring for Haptics
  • Device.Info() basic implementation