在后台运行应用程序超过10分钟 [英] Run app for more than 10 minutes in background

查看:223
本文介绍了在后台运行应用程序超过10分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我进入后台状态时,我试图让iOS应用保持活动状态超过10分钟。

I am trying to keep the iOS app in active state for more than 10 mins when it enters in background state.

我该如何实现它。

推荐答案

请参阅 iPhoneAppProgrammingGuide 。简而言之,您的应用必须是以下类型之一:

See "Background Execution" section of the iPhoneAppProgrammingGuide. In short, your app must be one of these types:


  • 在后台播放用户可听内容的应用,例如音乐播放器应用程序

  • 随时向用户通知其位置信息的应用程序,例如导航应用程序

  • 支持互联网协议语音的应用程序( VoIP)

  • 需要下载和处理新内容的报亭应用

  • 从外部配件接收定期更新的应用

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

您必须按如下方式添加到Info.plist:
将UIBackgroundModes键添加到
Info.plist文件并将其值设置为包含以下一个或多个字符串的数组:

And you must add to the Info.plist as follows: Add the UIBackgroundModes key to your Info.plist file and set its value to an array containing one or more of the following strings:


  • 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 aNewsstand app that downloads and processesmagazine 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

请注意,审核流程的一部分将进行检查,以确保您的应用能够执行其在后台处理方面所做的工作。

Note that part of the review process will be checking to make sure that your app does what it says it's doing with regard to background processing.

这篇关于在后台运行应用程序超过10分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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