Donate widget configuration intent with INInteraction failed: Cannot donate interaction with intent that has no valid shortcut types

Do I need to check Intent is eligible for Siri Suggestions before donate it with INInteraction? But I only want to donate this intent so Siri can add my widget to Smart Stack, not in Lock Screen or other places.

Intent Definition:

  • Intent is eligible for widgets
  • Intent is user-configurable in the Shortcuts app and Add to Siri
  • Intent is eligible for Siri Suggestions

Donate Intent:

let widgetIntent = MyWidgetConfigurationIntent()
widgetIntent.range = .weekly // Configure my intent

let interaction = INInteraction(intent: intent, response: nil)
interaction.donate { error in
    if let error = error {
        // Error: Code=1901 "Cannot donate interaction with intent that has no valid shortcut types"
    } 
}

Sorry, don't know how to edit my question. I only check Intent is eligible for widgets in intent definition file.

Donate widget configuration intent with INInteraction failed: Cannot donate interaction with intent that has no valid shortcut types
 
 
Q