ios - 使用静默推送通知将 iOS 应用程序保持在 "Background"状态

标签 ios apple-push-notifications

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

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

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

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



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

最佳答案

在 iOS7 中添加了额外的背景模式,您可以查看可用的背景模式 here .
恕我直言,如果您滥用其中一种后台模式,该应用程序可能会被拒绝,说,我不认为静默推送通知适用于:keep an iOS app in "Background" state by sending it a silent push notification every few seconds .

另一件事是,无声推送通知的速率受到限制,如 here 所述。 ,所以我不确定它们是否会每隔几秒钟发送一次。

也许你可以使用另一个后台服务

关于ios - 使用静默推送通知将 iOS 应用程序保持在 "Background"状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24742490/

相关文章:

ios - 如何在 RxSwift 中写入行高?

ios - UIViewController 中的 UISearchBar

apple-push-notifications - 如何将 Apple 推送通知证书部署到客户站点

ios - 添加推送通知时出现无效权利错误

ios - 在未登录的情况下新安装应用程序后禁用推送通知

php - APNS - PHP Codeigniter 推送通知徽章不增加 iOS7

ios - AVPlayer swift : How do I hide controls and disable landscape view?

objective-c - AVFoundation 捕获 UIImage

ios - CLLocationManager 是异步的。遇到这个问题

ios - 如果通过电缆或网络从 xcode 安装,则为设备推送 token 注册不同的值