Add NSUserActiveTypes ->INSendMessage Intent to info. plist. Starting the app on watchos will handoff Outlook on Mac? Normal on iOS.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
WatchOS26 ControlWidget cannot display image copy or click
import Foundation
import SwiftUI
import WidgetKit
import AppIntents
internal import Combine
struct WidgetToggle: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: "com.example.myApp.performActionButton", provider: TimerValueProvider()) { isRunning in
ControlWidgetToggle("WidgetToggle", isOn: isRunning, action: ToggleTimerIntent()) { isOn in
Label(isOn ? "Running" : "Stopped", systemImage: isOn ? "hourglass.bottomhalf.filled" : "hourglass")
}
}
.displayName("WidgetToggle")
.description("WidgetToggle description")
}
}
struct TimerValueProvider: ControlValueProvider {
var previewValue: Bool {
return false
}
func currentValue() async throws -> Bool {
return TimerManager.shared.isRunning
}
}
struct ToggleTimerIntent: SetValueIntent {
static var title: LocalizedStringResource = "WidgetToggle"
@Parameter(title: "Toggle")
var value: Bool
func perform() async throws -> some IntentResult {
TimerManager.shared.isRunning = value
return .result()
}
}
class TimerManager: ObservableObject {
static let shared = TimerManager()
@Published var isRunning = false
}
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
https://developer.apple.com/watchos/whats-new/
Is there an example demo available
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
watchos 26 新增了睡眠评分,开发者如何获取这个评分,有相关的文档和API吗?
Watchos 26 has added a sleep rating. How can developers obtain this rating? Do you have any relevant documentation and APIs?
Topic:
App & System Services
SubTopic:
Health & Fitness