如何在iOS中实现后台RSS阅读器?(How can I implement a background RSS reader in iOS?)

编程入门 行业动态 更新时间:2024-10-20 00:26:39
如何在iOS中实现后台RSS阅读器?(How can I implement a background RSS reader in iOS?)

我需要在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 updates

I 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-central

From the Apple Docs: [Source]

更多推荐

本文发布于:2023-07-07 21:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068503.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阅读器   后台   如何在   iOS   RSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!