在后台使用 iOS 设备的加速度计

Using the accelerometer of an iOS device in background

我有一个 iPad,在我工作的时候整天都在我的 table 家里。我的孩子在身边(他们被禁止使用它),我想知道我是否可以设计一个应用程序(或下载它,但我没有找到),如果设备移动会提醒我。 例如,如果我的一个孩子捡起它,它会通过加速度计检测到它并给我发一封电子邮件。

这是否可能与不是 运行 但刚刚安装的应用程序有关?就像背景中是 运行 一样。我知道 GPS 是可能的,但我想用加速度计来检测小动作。

感谢您的帮助

您的问题已在 Whosebug 的多个线程中发出。 下次你真的应该使用搜索功能或至少 post 一些代码。

同时检查一下: 从这个线程 Receive accelerometer updates in background:

You can not only use accelerometer for fatching data from background,

And as you say your App registers for location updates , start location manager in forground.

Implementing Long-Running Background Tasks For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:

Apps that play audible content to the user while in the background, such as a music player app Apps that record audio content while in the background. Apps that keep users informed of their location at all times, such as a navigation app Apps that support Voice over Internet Protocol (VoIP) Apps that need to download and process new content regularly Apps that receive regular updates from external accessories

精简版:无法仅在后台获取加速度数据。