I show some content in LiveActivity Dynamic Island and added a button. As buttons work with App Intent I created an Intent. When the button is clicked I get the following error
Could not find an intent with identifier MyIntent, mangledTypeName: Optional("19LiveWidgetExtension10MyIntentV")
MyIntent.swift
import Foundation
import AppIntents
struct MyIntent: LiveActivityIntent {
public init() { }
func perform() async throws -> some IntentResult {
print("click")
return .result()
}
}
MyLiveActivity.swift
...
DynamicIslandExpandedRegion(.bottom) {
HStack(alignment: .top) {
Button(intent: MyIntent()) {
Image(systemName: "bolt.fill")
}
}
.tint(.white)
.padding()
}
....
The Intent is added to all targets. Any ideas?