2nd deprecation of shortcuts action

My app has had shortcuts support since the Siri Intent days, so I have app intents with CustomIntentMigratedAppIntent to make sure old shortcuts continue working.

Now I need to make further changes to one such shortcuts actions so I need to make a 2nd app intent to take the place of my older app intent that itself took the place of a siri intent.

I need the old app intent to still exist for the sake of old shortcuts but I find that having isDiscoverable = false doesn't hide the 1st app intent so long as it has CustomIntentMigratedAppIntent.

Is there any solution or do I have to either break old shortcuts or accept duplicate shortcuts actions to move my app intents forward?

Answered by Frameworks Engineer in 891783022

You can conform your old intent to DeprecatedAppIntent (in addition to keeping its CustomIntentMigratedAppIntent conformance).

struct OldDoThingIntent, CustomIntentMigratedAppIntent, DeprecatedAppIntent {
    static let intentClassName = "OldDoThingIntent" // keep matching the legacy SiriKit intent

    static var deprecation: IntentDeprecation<NewDoThingIntent> {
        .init(
            message: "Use 'Do Thing' instead.",
            replacedBy: NewDoThingIntent.self
        )
    }
    // ...
}

What this gets you:

  • The old intent stays registered, so existing shortcuts (which migrated from the SiriKit intent and are bound by intentClassName) keep running.
  • replacedBy: lets the Shortcuts app point users at NewDoThingIntent.
Accepted Answer

You can conform your old intent to DeprecatedAppIntent (in addition to keeping its CustomIntentMigratedAppIntent conformance).

struct OldDoThingIntent, CustomIntentMigratedAppIntent, DeprecatedAppIntent {
    static let intentClassName = "OldDoThingIntent" // keep matching the legacy SiriKit intent

    static var deprecation: IntentDeprecation<NewDoThingIntent> {
        .init(
            message: "Use 'Do Thing' instead.",
            replacedBy: NewDoThingIntent.self
        )
    }
    // ...
}

What this gets you:

  • The old intent stays registered, so existing shortcuts (which migrated from the SiriKit intent and are bound by intentClassName) keep running.
  • replacedBy: lets the Shortcuts app point users at NewDoThingIntent.
2nd deprecation of shortcuts action
 
 
Q