My app presents UIActivityViewController with a string and reads returnedItems in completionWithItemsHandler, so the user can transform text with an action. This works with third-party action extensions that call completeRequest(returningItems:).
Shortcuts with "Show in Share Sheet" enabled appear in the same list and receive the text as input, but I never get anything back. With a shortcut that is just
- Receive input from Share Sheet
- Change Case: Change Shortcut Input to UPPERCASE
- Stop and Output: Updated Text
the handler is called like this:
activityType=com.apple.shortcuts.Run-Workflow.(null) completed=NO error=nil returnedItems=0
while my own action extension doing the same thing gives:
activityType=com.example.ShareSheetReturn.UppercaseControl completed=YES error=nil returnedItems=1 attachmentTypes=[public.plain-text]
The shortcut does run and computes the right result. The Shortcuts logs for the run show the request being created with "output behavior: Ignore" and the run ending with no output:
request: <WFWorkflowRunRequest: 0x109a63d40, runSource: action_extension, input: yes, presentationMode: Persistent, output behavior: Ignore, ...>
Action <WFHandleCustomIntentAction: 0x1019d4620, identifier: is.workflow.actions.text.changecase> finished with output of 1 items and first item: <WFStringContentItem: 0x107958690>: HELLO SHORTCUTS
Shortcut <WFWorkflow: 0x1019d3900, name: Change Case, actions: 2> has finished running with output: (null).
Previous versions of Shortcuts did pass the result back through the share sheet, so this looks like a regression.
Tested on the iOS 27.3 simulator with Xcode 27.3 beta.
Is there any way for a shortcut run from the share sheet to hand its output back to the presenting app, or any configuration of the shortcut that makes this work? If not, I would like the output of "Stop and Output" to be returned as NSExtensionItems again.
Filed as FB25701248 with a minimal sample project (a text view, a button and a control action extension).