App Intent definition changed, but it is not synced to the Shortcuts app

591 Views Asked by At

I'm changing an App Intent definition, but the changes are not reflected in the Shortcuts app when I try to use my changed intent as an action in a Shortcut.

And trying to run the shortcut gives an exception:

[Execution] perform() returned types not declared in method signature

AppIntents/PerformActionExecutorTask.swift:78: Fatal error: perform() returned types not declared in method signature

Is there a way to force reload the Shortcuts app to get the new intents or am I missing something more basic?

1

There are 1 best solutions below

0
On BEST ANSWER

I figured it out. When returning a result together with a value the return definition of the perform() function needs to include IntentResult like so:

// Works as described ✅
func perform() async throws -> some IntentResult & ReturnsValue<String> {
    return .result(value: "Some text")
}

Including just ReturnsValue<String> will result in the exception above and modified version of the intent will not be picked up by the compiler.

// Incorrect function annotation ❌
func perform() async throws -> some ReturnsValue<String> {
    return .result(value: "Some text")
}