Hotwire Native

Hotwire Native is the framework FlowDice will use to ship native iOS and Android apps in Phase 3. It wraps the existing Rails web app in native shells with platform-correct navigation.

How It Works

The Rails app renders HTML inside a native WebView (WKWebView on iOS, WebView on Android). Hotwire Native intercepts link taps and manages a native navigation stack with platform-appropriate animations. The chrome is native; the content is web.

Why It Fits FlowDice

  • The Rails app is the app — one codebase serves browser, PWA, and native
  • Ship updates by deploying Rails — no App Store review for most changes
  • Progressive enhancement: replace specific screens with native code where needed
  • App Store/Play Store distribution
  • Access to device APIs (haptics, sound, push notifications) in Phase 3

What FlowDice Needs to Do Now (Phase 1)

Building Hotwire Native-ready from day one:

  • Mobile-first responsive CSS
  • URL-based navigation (standard Turbo Drive, not heavy Turbo Frames)
  • Clean URL structure that maps to native navigation stacks
  • Service worker for offline support

What Gets Added in Phase 3

  • iOS shell (Swift, Xcode, hotwire-native-ios Swift Package)
  • Android shell (Kotlin, Android Studio, hotwire-native-android Gradle dependency)
  • Bridge components for native UI elements (toolbar buttons, modals)
  • Native screens for high-fidelity features (sound effects, haptics)
  • Path configuration JSON for URL-to-screen mapping

Key Libraries

LibraryPlatformLanguage
hotwire-native-iosiOSSwift
hotwire-native-androidAndroidKotlin
hotwire-native-bridgeWeb/JSJavaScript
turbo-railsRailsRuby
stimulus-railsRailsRuby

Resources

  • Official docs: native.hotwired.dev
  • Joe Masilotti’s book: Hotwire Native for Rails Developers (Pragmatic Bookshelf, ~$31)
  • William Kennedy’s free blog tutorials (iOS + Android series)
  • Joe Masilotti’s bridge-components collection on GitHub

Desktop?

Hotwire Native only targets iOS and Android. Desktop is covered by the PWA. There’s a potential community project to build a Hotwire Desktop on Tauri (using OS-native WebViews), but it doesn’t exist yet. See Hotwire Desktop Idea.

See also: Architecture, FlowDice, Android Auto