I have an iOS app with an action extension that is used to perform actions on images inside other apps when they present UIActivityViewController. Everything is working as intended - if I present an activity sheet in another app, my action extension appears in the list alongside the system actions (such as Save to Files and Create Watch Face etc).
However, the action extension also appears in my own app when I present UIActivityViewController on an image there, which I do not want to happen. Is there any way to prevent my own action extension from appearing in UIActivityViewController inside my own app?
I've tried adding an entry to excludedActivityTypes when presenting UIActivityViewController as follows, but this did not work:
let activity = UIActivityViewController(activityItems: [media], applicationActivities: nil)
activity.excludedActivityTypes = [UIActivity.ActivityType("com.example.ActionExtensionIdentifier")]
// other setup code
present(activity, animated: true)