简体   繁体   English

如何通过代码知道用户是否在“设置”中禁用了蜂窝数据?

[英]How to know by code if the user has disabled cellular data in Settings?

How to know by code if the user has disabled cellular data in Settings ? 如何通过代码知道用户是否在“设置”中禁用了蜂窝数据?

I have tried with Reachability but this tell me only if internet connection is reachable... 我已经尝试过可到达性,但这仅在互联网连接可用时告诉我...

You cannot check this via code. 您无法通过代码检查此内容。 Apple have not made this part of the public API. 苹果尚未将此部分纳入公共API。 The best you can do is just check if there is connection as you're doing now. 您能做的最好的事情就是检查您现在是否已建立连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何知道用户是否在设置 - >辅助功能中禁用了透明度? - How to know if User disabled transparency in Settings -> Accessibility? 了解iOS设备是否具有蜂窝数据功能 - Know if iOS device has cellular data capabilities 我如何知道我的 iOS 应用程序的蜂窝网络访问是否被禁用? - How do I know if cellular access for my iOS app is disabled? 如何确定用户是否尚未注册接收推送通知和/或禁用其设置 - How to determine if a user has not registered to receive push notifications and/or has their settings disabled iOS检测系统“设置/蜂窝/蜂窝数据”主开关的设置吗? - iOS Detect setting of system “Settings/Cellular/Cellular Data” master switch? 我们如何知道用户在 Swift 中为我们的应用程序启用或禁用了通知服务? - How do we know that user has enabled or disabled for notification service for our app in Swift? 如何判断用户是否为我的应用关闭了蜂窝数据? - How to tell if the user turned off cellular data for my app? 检查蜂窝数据是否已关闭 - Checking if Cellular Data has been turned off 是什么使“蜂窝数据”切换出现在iOS 13的应用程序设置中? - What makes the “cellular data” toggle appear in the settings of an app in iOS 13? 如何确定iOS设备是否有蜂窝无线电? - How to determine if an iOS device has a cellular radio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM