我需要在iOS上实现一个RSS阅读器,每隔#分钟更新一次,即使应用程序在后台也是如此。 我不介意使用NSXMLParser来解析数据,我只需要一个很好的方法在后台按预定的时间间隔执行以下操作:
下载feed的XML文档 解析文档 让用户知道任何更新我知道如何在应用程序运行时执行所有这些操作,我只需要知道即使应用程序在后台也能确保它们完成。
I need to implement an RSS reader on iOS which updates its feed every # minutes, even if the app is in the background. I don't mind using NSXMLParser to do the parsing of the data, I just need a good way to do the following in the background at scheduled intervals:
Download the feed's XML document Parse the document Let the user know of any updatesI know how to do all of these things when the app is running, I just need to know how to make sure they get done even if the app is in the background.
最满意答案
Apple对允许在后台执行哪些应用程序有严格的规定。 不幸的是,您的应用不适合任何这些类别。
audio - 应用程序在后台播放可听内容给用户。 (此内容包括使用AirPlay播放音频或视频内容。) location - 该应用程序可让用户随时了解其位置,即使它在后台运行也是如此。 voip - 该应用程序使用户能够使用Internet连接拨打电话。 报亭 - 内容 - 该应用程序是一个报亭应用程序,可在后台下载和处理杂志或报纸内容。 external-accessory - 该应用程序与硬件附件配合使用,需要通过外部附件框架定期提供更新。 蓝牙中心来自Apple Docs: [来源]
Apple has strict rules about which apps are allowed to execute in the background. Your app, unfortunately, does not fit any of these categories.
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-centralFrom the Apple Docs: [Source]
更多推荐
发布评论