We are developing an app for iOS 16 using App Intents and Siri.
We have been testing the behavior of opening another App Intent by passing the opensIntent argument to the result function in the App Intent with iOS 16.4 devices.
As a result, we found that the dialog text specified in the result argument of the Intent to which it transitions is not displayed and therefore does not work. And also found that when invoked from Siri, the Intent passed to the opensIntent argument is invoked "twice".
Are these behaviors bugs? Any ideas?
The following is a sample code and logs.
import AppIntents
struct PrimaryIntent: AppIntent {
static var title: LocalizedStringResource = "Primary"
func perform() async throws -> some OpensIntent {
print("\(String(describing: Self.self)).\(#function): invoked")
return .result(opensIntent: SecondaryIntent())
}
}
struct SecondaryIntent: AppIntent {
static var title: LocalizedStringResource = "Secondary"
func perform() async throws -> some ProvidesDialog {
print("\(String(describing: Self.self)).\(#function): invoked")
return .result(dialog: .init(stringLiteral: "test"))
}
}
struct ShortcutsProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(intent: PrimaryIntent(), phrases: ["\(.applicationName)"])
}
}
logs from Shortcut App
PrimaryIntent.perform(): invoked
SecondaryIntent.perform(): invoked
# is not displayed dialog...
logs from Siri
PrimaryIntent.perform(): invoked
SecondaryIntent.perform(): invoked
SecondaryIntent.perform(): invoked
# is not displayed dialog...
# SecondaryIntent invoked twice...