Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
31 lines
1.2 KiB
Swift
Executable File
31 lines
1.2 KiB
Swift
Executable File
// CrossSoundWidgetBundle.swift — CrossSoundWidget extension target ONLY.
|
|
//
|
|
// Ported from CrossSound-Flutter ios/CrossSoundWidget/CrossSoundWidgetBundle.swift.
|
|
// Entry point for the widget extension. The extension's minimum deployment
|
|
// target is iOS 17.0 (interactive Button(intent:) and containerBackground).
|
|
//
|
|
// Port note: the Flutter bundle also registered CrossSoundGlassesWidget (Meta
|
|
// glasses). That widget was deliberately NOT ported here, so its entry is gone;
|
|
// bring CrossSoundGlassesWidget.swift + ConnectGlassesIntent along before
|
|
// restoring it.
|
|
|
|
import WidgetKit
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct CrossSoundWidgetBundle: WidgetBundle {
|
|
var body: some Widget {
|
|
CrossSoundNowPlayingWidget()
|
|
// No Live Activity, on purpose. ActivityConfiguration requires a
|
|
// dynamicIsland closure and iOS shows the island for any activity that is
|
|
// running, so one cannot be kept without the other — deleting the
|
|
// configuration is what removes the Dynamic Island. Lock Screen media
|
|
// controls are unaffected: those come from MPNowPlayingInfoCenter.
|
|
// Control Center's rain toggle. iOS 18 is where Controls exist at all;
|
|
// the app itself still runs on 17.
|
|
if #available(iOS 18.0, *) {
|
|
AmbienceControlWidget()
|
|
}
|
|
}
|
|
}
|