Somehow related, I'm trying to build an example app to get familiar with this new extension.
I followed the steps in the docs but I think I'm missing something.
I added the Control through a Widget Extension, and I see that the perform method is called in my Intent, however I'm missing the part where this perform method would open the UI to capture the photos.
This is my Intent:
struct MyAppCaptureIntent: CameraCaptureIntent {
static var title: LocalizedStringResource = "MyAppCaptureIntent"
typealias AppContext = MyAppContext
static let description = IntentDescription("Capture photos with MyApp.")
@MainActor
func perform() async throws -> some IntentResult {
let dialog = IntentDialog("Intent result")
do {
if let context = try await MyAppCaptureIntent.appContext {
return .result()
}
} catch {
// Handle error condition.
}
return .result()
}
}
struct MyAppContext: Decodable, Encodable {
var data = ContextData()
}
struct ContextData: IntentResult, Decodable, Encodable {
var value: Never? {
nil
}
}
How do I connect this with my LockedCameraCaptureExtension?