I've setup an intractable Widget in iOS 17 which uses an AppIntent from an SPM package but nothing works when you tap on the button in the widget.
Supposedly you should be able to use AppIntentsPackage
, which should make it possible to use AppIntents from other frameworks/SPM package(?), but I cannot get it to work. This is my setup:
SPMPackage
public struct MyAppIntent: AppIntent { ... }
public struct MyAppIntentPackage: AppIntentsPackage { }
WidgetExtension
import SPMPackage
struct MyWidgetEntryView: View {
var body: some View {
Button(intent: MyAppIntent()) {
Text("Tap here")
}
.containerBackground(...)
}
}
extension MyWidgetBundle: AppIntentsPackage {
static var includedPackages: [AppIntentsPackage.Type] = [
MyAppIntentPackage.self
]
}
Seems to have set it up exactly how Apple explains it in the documentation but it doesn't work. Am I missing something? Thanks!