I want to move the app to the home screen if there is no response from the user after a few seconds after launching the app.
Is it possible to automatically go to the home screen by running the app or pressing the button?
Is it possible to automatically go to the home screen by running the app or pressing the button?
On iOS?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I want to move the app to the home screen
home screen of iOS ? or of your app ?
You can do action after a delay: https://stackoverflow.com/questions/59682446/how-to-trigger-action-after-x-seconds-in-swiftui
Just add another @State var cancelled = true
And change to false if user takes any action. Use it in test for going homeScreen.
If you mean exiting out of your app to the home screen of the device, that’s called “crashing” and will likely get you rejected by App Review. On iOS you should never have a user-facing feature for quitting the app.
On iOS you should never have a user-facing feature for quitting the app.
Yep. We even have a document to that effect, namely QA1561 How do I programmatically quit my iOS application?.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
To elaborate on my question, I want the app to run in the background when the app is launched, and if the user does not press the cancel button, the app will forcibly go to the home screen and run the app in the background.
the app will forcibly go to the home screen
Nope, that’s not a supported app lifecycle in iOS.
I want the app to run in the background
First, please see this excellent summary of issues you need to consider: iOS Background Execution Limits.
After reviewing that information, does your desired behavior align with any of the supported scenarios?