Doug Smith
Doug Smith

Reputation: 29316

iOS 13 performActionFor shortcutItem doesn't get called in SceneDelegate now on launch, but does after app launches. Why?

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?

Upvotes: 4

Views: 1054

Answers (1)

Thenappan Ramanathan
Thenappan Ramanathan

Reputation: 51

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{
    }
}

Upvotes: 5

Related Questions