电话区号到iOS上的城市名称 [英] Telephone area code to city name on iOS

查看:123
本文介绍了电话区号到iOS上的城市名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apple的内置Voicemail应用程序中,当它找到您的通讯录中无法识别的电话号码时,它会在该号码下显示大概的位置,大概是基于该电话号码的.他们是怎么做到的??我猜想手机上会有一个很大的区号和交换号码数据库,每个数据库都映射到一个城市或地区名称.有人知道通过公共API应用程序是否可以访问此映射吗?

On Apple's built-in Voicemail app, when it finds a phone number it does not recognize in your address book, it displays an approximate location under the number, presumably based on the phone number. How did they do that?? I'd guess there's a large database of area codes and exchange numbers on the phone, each mapping to a city or region name. Does anyone know if this mapping is accessible to apps via a public API?

有很多样板代码可用于将邮政编码映射到城市,但是我看不出在区号/交换方面有多少相同的代码.有什么想法吗?

There's lots of boilerplate code out there for mapping ZIP code to city, but I don't see much that does the same with area code / exchange. Any ideas?

推荐答案

有许多网站可以告诉您指定地区代码的城市. Verizon有一个,以及其他网站,例如 http://www.411.com/area_zip_codes 做同样的事情.您可能也可以在本地电话簿的前面找到相同的信息.

There are a number of web sites that will tell you the city or cities for a given area code. Verizon has one, and other sites like http://www.allareacodes.com/ and http://www.411.com/area_zip_codes do about the same thing. You can probably find the same information in the front of your local telephone directory, too.

由于可能的区号少于1000个,因此我要查找地区代码列表可以包含在程序中.这样,无论网络连接是否可用,您的应用程序的这一方面都将起作用.

Since there are fewer than 1000 possible area codes, I'd look for an area code list that you can include in your program. That way, this aspect of your app will work whether a network connection is available or not.

这篇关于电话区号到iOS上的城市名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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