I have a static quick action with the following setup.
Setup quick action
UIApplicationShortcutItemIconSymbolName = "alarm"
UIApplicationShortcutItemType = "com.yocto.xyz.action"
UIApplicationShortcutItemTitle = "Hello"
However, when I tap on it, none of the following function is executed
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print(">>>> AppDelegate didFinishLaunchingWithOptions")
return true
}
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
print(">>>> AppDelegate shortcutItem.type (shortcutItem.type)")
completionHandler(true)
}
...
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
print(">>>> SceneDelegate willConnectTo")
}
May I know what could have gone wrong? What else might I be missing?
Here’s a demo project to demonstrate the issue: https://github.com/yccheok/quick-action-not-working
Thank you.