终止应用程序后如何运行Swift代码

终止应用程序后如何运行Swift代码

问题描述:

当用户从后台终止我的应用程序时,是否可以无限/长时间运行ios应用程序代码?请帮助我.

Is there a way to run ios application code unlimited/ long time while the user terminate my app from background? Please help me.

我进行了很多搜索,但没有找到合适的解决方案.

I have searched a lot but did not find any proper solution.

不可能.

您可以在后台运行一堆服务,例如Location Services BUT,即使您需要配置应用程序并获得END USER的同意才能继续监视他/她的位置.即使用户同意,他也有很多选择,例如在使用应用程序时监视我的位置,或者始终或永远不会.

There are a bunch of services that you can run in the background such as Location Services BUT even for that you need to configure your app and have the CONSENT of the END USER to continue to monitor his/her location. Even if the user consents, he has a bunch of options like monitor my location while using the app or always or never.

所有这些选项都是用户可以在iOS设备的设置"部分中更改的选项.

All these options are something that user can change in the "Settings" section of the iOS device.

即使您在未经最终用户同意的情况下尝试运行您的应用程序或任何服务背景,Apple也会绝对拒绝您的应用程序.

Even if you try to run your app or any of the services background without the consent of the End user, Apple will definitely reject your app.

希望这会有所帮助.