Add iOS app with CarPlay and Siri
SwiftUI port of the Android app under ios/, with CarPlay browse and Now Playing, Siri play-media intents, and a build-ipa.sh script that makes an unsigned IPA for sideloading. README gets an iOS section and the vibecoded disclaimer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
45bc0eefe0
commit
fdf9e970b2
45 files changed
+9822
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import AVFoundation
|
||||
import Intents
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
final class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||
try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, policy: .longFormAudio)
|
||||
MainActor.assumeIsolated { _ = AppGraph.shared }
|
||||
return true
|
||||
}
|
||||
|
||||
/// Phone windows go to SwiftUI; CarPlay gets its own scene delegate.
|
||||
func application(_ application: UIApplication, configurationForConnecting session: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
if session.role == .carTemplateApplication {
|
||||
let c = UISceneConfiguration(name: "CarPlay", sessionRole: session.role)
|
||||
c.delegateClass = CarPlayScene.self
|
||||
return c
|
||||
}
|
||||
return UISceneConfiguration(name: "Phone", sessionRole: session.role)
|
||||
}
|
||||
|
||||
/// Siri: "Play <album> on Stemify".
|
||||
func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? {
|
||||
intent is INPlayMediaIntent ? PlayMediaHandler() : nil
|
||||
}
|
||||
}
|
||||
|
||||
@main
|
||||
struct StemifyApp: App {
|
||||
@UIApplicationDelegateAdaptor(AppDelegate.self) private var delegate
|
||||
@Environment(\.scenePhase) private var phase
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
RootView()
|
||||
}
|
||||
.onChange(of: phase) { _, p in
|
||||
if p == .active { AppGraph.shared.eq.refreshRoute() }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user