Add Spotify integration with toggleable music source
- Add OAuth 2.0 PKCE authentication for Spotify Web API - Create SpotifyNowPlayingMonitor for polling current track - Add Settings tab with music source toggle (Apple Music/Spotify) - Store tokens securely in Keychain - Display current track on Glass as NOW_PLAYING card 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,12 +12,15 @@ struct irisApp: App {
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
@StateObject private var ble: BlePeripheralManager
|
||||
@StateObject private var orchestrator: ContextOrchestrator
|
||||
@StateObject private var spotifyAuth: SpotifyAuthManager
|
||||
|
||||
init() {
|
||||
let bleManager = BlePeripheralManager()
|
||||
bleManager.start()
|
||||
let spotify = SpotifyAuthManager()
|
||||
_ble = StateObject(wrappedValue: bleManager)
|
||||
_orchestrator = StateObject(wrappedValue: ContextOrchestrator(ble: bleManager))
|
||||
_spotifyAuth = StateObject(wrappedValue: spotify)
|
||||
_orchestrator = StateObject(wrappedValue: ContextOrchestrator(ble: bleManager, spotifyAuth: spotify))
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
@@ -25,6 +28,12 @@ struct irisApp: App {
|
||||
ContentView()
|
||||
.environmentObject(ble)
|
||||
.environmentObject(orchestrator)
|
||||
.environmentObject(spotifyAuth)
|
||||
.onOpenURL { url in
|
||||
if url.scheme == "iris-spotify-auth" {
|
||||
spotifyAuth.handleCallback(url: url)
|
||||
}
|
||||
}
|
||||
.onChange(of: scenePhase) { phase in
|
||||
if phase == .active || phase == .background {
|
||||
ble.start()
|
||||
|
||||
Reference in New Issue
Block a user