问题描述
如何让应用在启动时运行,而不是在后台运行。我一直需要它在前景中。这可能吗?
How can I make an app run at startup and not in the background. I need it in foreground for the whole time. Is that possible?
我有:
[UIApplication sharedApplication].idleTimerDisabled = YES;
这使得应用程序始终在前台运行。
但我不知道如何让它在iOS启动前台运行。
Thats keeps an app always running in the foreground.But I don't know how make it run at iOS startup in foreground.
推荐答案
唯一的方法是
The only way is Guided Access
Guided Access将您的设备限制为单个应用程序,并允许您控制可用的应用程序功能。
Guided Access limits your device to a single app and lets you control which app features are available.
因此,当Guided Access为ON时,您的应用程序将在启动时运行。
So when the Guided Access is ON, your app run at startup.
为了让它在重启后工作(电源故障后等),需要禁用设备的密码。
In order for it to work after a reboot (after a power failure or so), the passcode of the device needs to be disabled.
这篇关于使iOS应用程序在启动时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!