performActionFor shortcutItem gets called in my SceneDelegate if the app has already launched, but it doesn't get called if the app actually launches from a shortcut item. Why is this?

1

There are 1 best solutions below

1
On

You can get the ShortcutItems from willConnectTo function in sceneDelegate when the app is launched from shortcut item (and when there is no instance of app is in background)

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let shortcutItems = connectionOptions.shortcutItem{
    }
}