在 iOS 应用程序中获取基站信息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4567708/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting cell tower information in an iOS application?
提问by Alex
My question is simple but I haven't found a good answer anywhere. My question is this: Is there a way through either the iOS SDK or third-party frameworks to get cell tower location data? Meaning cell tower location, distance from you, etc.
我的问题很简单,但我没有在任何地方找到好的答案。我的问题是:有没有办法通过 iOS SDK 或第三方框架来获取基站位置数据?意思是手机信号塔的位置、与您的距离等。
The signal applicationfor iOS does this, so I know it's possible, but I can't seem to find any documentation or resources on the matter.
iOS的信号应用程序就是这样做的,所以我知道这是可能的,但我似乎找不到关于此事的任何文档或资源。
Thanks!
谢谢!
回答by Christian
There is no official way to do this as far as I know. iOS SDKs abstract that info to a single and easy to use location API.
据我所知,没有官方方法可以做到这一点。iOS SDK 将该信息抽象为单个且易于使用的位置 API。
The application you link is probably using private APIs from iOS. That means that developer is using undocumented functions from iOS. If you really want to find more about it, you can try contacting him.
您链接的应用程序可能正在使用来自 iOS 的私有 API。这意味着开发人员正在使用 iOS 中未记录的功能。如果你真的想了解更多,你可以尝试联系他。
Also check this: iOS Private API Documentation
回答by Di Wu
The signal app used some private API which will lead to immediate rejection by Apple, which is why it says jailbreak device only.
信号应用程序使用了一些私有 API,这会导致苹果立即拒绝,这就是为什么它说仅越狱设备。
Plus, you may find this post helpful: iPhone signal strength
另外,您可能会发现这篇文章很有帮助:iPhone 信号强度
回答by Horst
The CellStumbler application (CellStumbler at code.google.com) uses undocumented methods in the CoreTelephony framework. There is a CellInfo struct defined which can be queried via the _CTServerConnectionCellMonitorGetCellInfo method.
CellStumbler 应用程序(位于 code.google.com 的 CellStumbler)使用 CoreTelephony 框架中未记录的方法。定义了一个 CellInfo 结构,可以通过 _CTServerConnectionCellMonitorGetCellInfo 方法进行查询。
However, on iPhone-4S - iOS5 the CTServerConnectionCellMonitorGetCellCount always return zero - so no cell info can be queried. Things may look different on a iPhone4/3S since Apple changed the baseband modem from Infineon Gold to Qualcomm mdm6610.
但是,在 iPhone-4S - iOS5 上,CTServerConnectionCellMonitorGetCellCount 总是返回零 - 因此无法查询单元格信息。iPhone4/3S 上的情况可能有所不同,因为 Apple 将基带调制解调器从 Infineon Gold 更改为 Qualcomm mdm6610。
You mal also try to evaluate the built-in FieldTest app (just dial *3001#12345#* to start) which gives you a couple of info related to your cellular network status.
您还可以尝试评估内置 FieldTest 应用程序(只需拨打 *3001#12345#* 即可启动),它会为您提供一些与您的蜂窝网络状态相关的信息。