如何唤醒应用 [英] How to wake up an app

查看:61
本文介绍了如何唤醒应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以每隔 x 分钟唤醒一个应用程序,以便该应用程序可以在后台执行某些操作?因此该应用程序停留在后台.

Is it possible to wake up an app every x minutes, so that the application can do something in the background? So the app stays in the background.

推荐答案

这不会每隔x分钟唤醒应用程序,但会在后台启动应用程序:

This doesn't wake an app up every x minutes, but will launch an app into the background:

如果某个应用已表明要监视此类事件,则该应用可能会因位置发生重大变化而被唤醒.

An app can be woken by a significant location change, if the app has indicated that it wants to monitor such events.

请参阅: CLLocationManager文档

寻找一种名为 startMonitoringSignificantLocationChanges 的方法.如果您的应用程序不在前台或根本不运行时发生了重大的位置变化,则您的应用程序将在后台启动,从而允许该应用程序仅执行后台操作(例如,不运行任何视图代码).

Look for a method called startMonitoringSignificantLocationChanges. If a significant location change occurs while your app is not in the foreground or isn't running at all, your application will be launched in the background, allowing the app to perform background-only operations (e.g. no view code will run).

这篇关于如何唤醒应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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