使用静默推送通知将 iOS 应用保持在“后台"状态 [英] Using silent push notifications to keep an iOS app in "Background" state

查看:64
本文介绍了使用静默推送通知将 iOS 应用保持在“后台"状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过每隔几秒向 iOS 应用发送静默推送通知来使其保持在后台"状态?我想定期运行后台任务,这似乎是一个可行的解决方案.如果是这样,这在 App Store 使用条款下是否可以接受?

Is it possible to keep an iOS app in "Background" state by sending it a silent push notification every few seconds? I want to run background tasks on a regular interval and this seems like a viable solution. If so, is this acceptable under the App Store terms of use?

我计划构建的应用将依赖此功能,我担心 Apple 会从 App Store 拒绝它.

The app I am planning to build would rely on this functionality and I am concerned that Apple will reject it from the App Store.

具体来说,是指南中的这一部分我不确定:

Specifically, it’s this section in the guidelines that I am not sure about:

5.1 未经用户同意而发送推送通知的应用程序,以及需要推送通知功能的应用程序,将被拒绝

5.1 Apps that send Push Notifications without first obtaining user consent, as well as apps that require Push Notifications to function, will be rejected

从技术上讲,我的应用可以在不允许推送通知的情况下使用,但它不会提供在后台记录数据的主要功能.

Technically my app could be used without allowing push notifications but it wouldn’t serve its primary function of recording data in the background.

推荐答案

在 iOS7 中添加了额外的背景模式,您可以查看可用的背景模式 此处.恕我直言,如果您滥用其中一种后台模式,该应用程序可能会被拒绝,也就是说,我认为静默推送通知不是为了:每隔几秒推送一次通知.

In iOS7 additional background modes were added, you can check out the available background modes here. IMHO, if you misuse one of the background modes, the app will probably be rejected, saying that , i don't think silent push notifications were meant for: keep an iOS app in "Background" state by sending it a silent push notification every few seconds.

另一件事是静默推送通知的速率受限,如此处,所以我不确定它们是否会每隔几秒发送一次.

another thing is that silent push notifications are rate limited as described here, so i'm not sure if they will be sent every few seconds.

也许你可以使用其他后台服务

maybe you can use another background service

这篇关于使用静默推送通知将 iOS 应用保持在“后台"状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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