简体   繁体   中英

Is there a way to not open the splash screen/app when launching a shortcut action in iOS?

func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem,
                     completionHandler: @escaping (Bool) -> Void) {
        if shortcutItem.type == "com.xyz.test.tests.firstAction" {
            if let url = URL(string: "https://www.google.com/") {
                DispatchQueue.main.async {
                    UIApplication.shared.openURL(url)
                }
                print("\(shortcutItem) was tapped")
            }

Here is the code i'm trying to execute. Is there a way to dismiss the application once the action is executed? If not i'm guessing it's required for context.

try exit(0) , but you can't publish it

Apple Review:

We found that your app includes a UI control for quitting the app. This is not in compliance with the iOS Human Interface Guidelines, as required by the App Store Review Guidelines.

Please refer to the attached screenshot/s for reference.

The iOS Human Interface Guidelines specify,

"Always Be Prepared to Stop iOS applications stop when people press the Home button to open a different application or use a device feature, such as the phone. In particular, people don't tap an application close button or select Quit from a menu. To provide a good stopping experience, an iOS application should:

Save user data as soon as possible and as often as reasonable because an exit or terminate notification can arrive at any time.

Save the current state when stopping, at the finest level of detail possible so that people don't lose their context when they start the application again. For example, if your app displays scrolling data, save the current scroll position."

It would be appropriate to remove any mechanisms for quitting your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM