iPhone 进入飞行模式时如何收到通知?
当设备进入(和离开)飞行模式时,有没有办法让我的应用程序收到通知?
Is there a way for my app to be notified when the device enters (and leaves) airplane mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Apple 的 Reachability 代码来查看是否用户打开您的应用程序或类似应用程序时可以访问网络。
但是,当用户在“设置”中进入或离开飞行模式时,您的应用程序不会收到任何通知/触发器来拦截/运行任意代码。
You can use Apple's Reachability code to see if a user has network access when they open your app or similar.
There is however no notification/trigger which your app can intercept/run arbitary code when a user enters or leaves airplane mode in the Settings.