I'm curious, why DynamicOptionsProvider is available on watchOS? Is there any way to present options to the user? For example in Emoji Rangers project that supports both watchOS and iOS:
struct EmojiRangerSelection: AppIntent, WidgetConfigurationIntent {
static let intentClassName = "EmojiRangerSelectionIntent"
static var title: LocalizedStringResource = "Emoji Ranger Selection"
static var description = IntentDescription("Select Hero")
@Parameter(title: "Selected Hero", default: EmojiRanger.cake, optionsProvider: EmojiRangerOptionsProvider())
var hero: EmojiRanger?
struct EmojiRangerOptionsProvider: DynamicOptionsProvider {
func results() async throws -> [EmojiRanger] {
EmojiRanger.allHeros
}
}
func perform() async throws -> some IntentResult {
return .result()
}
}
On watchOS we usually use recommendations()
to give the user predefined choice of configured widgets. Meanwhile in AppIntentProvider
recommendations are empty:
struct AppIntentProvider: AppIntentTimelineProvider {
...
func recommendations() -> [AppIntentRecommendation<EmojiRangerSelection>] {
[]
}
}
Does it imply that there's a way to use DynamicOptionsProvider
on watchOS somehow? BTW, WidgetConfiguration.promptsForUserConfiguration()
is one of the methods that are not available on watchOS.
And also, the Emoji Ranger project doesn't show widgets (complications) on watchOS out of the box.