终止应用程序后如何运行swift代码 [英] How to run swift code after terminate app

查看:39
本文介绍了终止应用程序后如何运行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.

推荐答案

不,这是不可能的.

您可以在后台运行许多服务,例如位置服务,但即使如此,您也需要配置您的应用程序并获得最终用户的同意才能继续监控他/她的位置.即使用户同意,他也有很多选项,例如在使用应用程序时监控我的位置,或者始终或从不.

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.

希望这会有所帮助.

这篇关于终止应用程序后如何运行swift代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆