在后台获取可访问性更改通知 [英] Getting Reachability changed notifications in the background

查看:61
本文介绍了在后台获取可访问性更改通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将媒体上传到服务器的应用程序.我使用 Andrew Donoho 的 Reachability 类来确定我是否通过 WiFi、WWAN 获得了 Reachability,或者是否无法访问.(用户可以选择是仅通过 WiFi 还是 WiFi 和 WWAN 上传媒体).如果应用程序进入后台,上传应该继续.但如果用户在后台运行时失去 WiFi 连接,上传应该停止.

Im developing an app that uploads media to a server. I use Andrew Donoho's Reachability class to determine if I've got Reachability via WiFi, WWAN or if it is not reachable. (Users can choose if they upload media only over WiFi or WiFi and WWAN). If the application enters the background, uploads should continue. But if the user loses WiFi connectivity while the app is in the background, uploads should stop.

这就是为什么我需要找到一种方法在后台获取 Reachability 更改通知,以便在用户失去 wifi 连接时停止上传.我看了又看,但没有看到有人谈论这个.似乎它并不是一个非常普遍的需求.

This is why I need to find a way to get Reachability changed notifications in the background, so I can stop uploading if the user loses wifi connectivity. I've looked and looked but haven't seen anyone talking about this. It seems it hasn't been a very widespread need.

推荐答案

可以参考苹果可达性代码

这篇关于在后台获取可访问性更改通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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