iOS VoIP 应用程序睡眠&可达性已更改,我可以收到通知吗?
我正在为 iOS 构建一个 voip 应用程序,并且正在后台处理工作。
到目前为止,我让 iOS 在应用程序休眠时监听 voip 套接字,并根据传入数据唤醒它。
我的问题是:
当可达性发生变化时(Wifi -> 3G、Wifi -> 其他 Wifi 等)
并且应用程序已暂停,我可以收到一些通知以重新连接我的 voip 套接字吗?
谢谢。
I'm building a voip app for iOS and I'm handling working at background.
So far, i have iOS listening to the voip socket while app sleeps and wake it uppon incoming data.
My question is:
When the reachability has changed (Wifi -> 3G, Wifi -> Other Wifi, etc)
and the app is suspended, can I get some notification in order to reconnect my voip socket?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案既是“是”又是“否”:
链接:
Answer was both Yes and No:
Links:
如果您有后台套接字,您可以订阅可达性通知,它们将在后台触发,以便您可以对可达性更改执行操作。如果您在点击后台时没有取消订阅通知,并且订阅通知的对象是您的应用程序委托,那么您仍然会收到通知。
If you have a backgrounding socket you can subscribe to reachability notifications and they will fire while backgrounded so you can perform actions on the reachability changes. If you don't unsubscribe to the notifications when you hit the background you'll still get them if the object subscribing to the notifications is your app delegate.