Show When Run toggle in custom actions

How do we remove the Show When Run toggle that has appeared in our custom intents / Shortcut actions in iOS 14? The toggle did not appear in iOS 13. It's on by default, which is annoying because it causes a pause in execution in previously released shortcuts that rely on these actions.

The intents are not part of the IntentUI target in my project.

Replies

Figured it out. To get rid of the Show When Run toggle, you have to do two things:

1) Have a blank success response template.
2) In the handle method of the intent, add the object you want to return in the response object as follows:

Code Block
let response = GetMacroIntentResponse(code: .success, userActivity: nil)
response.macro = macroDetails
return completion(response)