iOS后台应用程序网络访问 [英] iOS background application network access

查看:189
本文介绍了iOS后台应用程序网络访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要位置跟踪的应用程序,我认为它完全符合其中一个允许的背景模型。但是,当位置发生重大变化时,我需要发布到网络服务。我已经看过在后台处理中禁止声明网络访问的文章,但我没有在Apple的文档中看到过。

I have an application that requires location tracking and I think it fits squarely within one of the allowable background models. However, I need to post to a network service when there are significant changes of location. I've seen write-ups that state network access is prohibited in background processing, but I didn't read that in Apple's docs.

有谁知道它是否是犹太教(那些在后台进程中偶尔和非常快速的网络更新吗?

Does anyone know if it's kosher (wrt Apple policies) to make occasional and very quick network updates in a background process?

推荐答案

根据Apple文档,好的一点在后台只允许以下用法,每个服务都应该注册:

Good point, according to the Apple documentation only the following usages are allowed in background and each service should be registered:



  • audio-该应用程序可以播放在后台为用户提供内容。 (此内容包括使用AirPlay播放音频或视频内容
    。)

  • 位置 - 该应用可让用户随时了解其位置,即使它在后台运行也是如此。

  • voip-该应用程序使用户能够使用互联网连接拨打电话。

  • newsstand-content-该应用程序是一个报亭应用程序,在后台下载和处理杂志或报纸内容。

  • external-accessory-该应用程序适用于需要通过外部
    附件定期提供更新的硬件附件框架。

  • bluetooth-central-该应用程序与蓝牙配件配合使用,需要通过
    CoreBluetooth框架定期提供更新。

  • audio—The app plays audible content to the user while in the background. (This content includes streaming audio or video content using AirPlay.)
  • location—The app keeps users informed of their location, even while it is running in the background.
  • voip—The app provides the ability for the user to make phone calls using an Internet connection.
  • newsstand-content—The app is a Newsstand app that downloads and processes magazine or newspaper content in the background.
  • external-accessory—The app works with a hardware accessory that needs to deliver updates on a regular schedule through the External Accessory framework.
  • bluetooth-central—The app works with a Bluetooth accessory that needs to deliver updates on a regular schedule through the CoreBluetooth framework.

除了这项服务,你可以在后台中创建一个实际给你的有限长度任务结束网络的可能性k进程。

Other than this services, you can create a Finite-Length Task in the Background that actually give you the possibility to end a network process.


如果您的应用正在执行一些重要任务,例如将用户数据写入磁盘或b $ b,这可能很重要从网络服务器下载一个重要的文件

This can be important if your app is performing some important task, such as writing user data to disk or downloading an important file from a network server.

关于你的问题,你能否做到并不是很清楚如果您在后台运行位置服务,请进行快速网络连接。我会说YES是短暂的连接,但不完全确定。自iOS 4.0以来,这种用法在文档中被拒绝和清除,现在该部分已被删除。

Regarding your question, it's not really clear if you can or not can do a quick network connection if you've a location service running in background. I would say YES for a short connection, but not totally sure. Since iOS 4.0 this usage was denied and clear in documentation, now that part has been removed.

这篇关于iOS后台应用程序网络访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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