I want to make an application on iPhone which locates the mobile number region(area) when the user gets a call. Can anybody give me guideline how to accomplish that task?
2 Answers
You can't access the details of an incoming call on the iPhone.
Crazy idea: User would define a phone number of your server (SIP, VOIP) as "forward when declined"-number. When the user gets a call, he would simply decline it, so it would be forwarded to your server. There you could extract the information and send it to the iPhone (Push Service). And finally you would redirect the call back from the server to the user's iPhone.
-
:ok thanks for that info ,if generally i want track any mobile number region on iphone is it possible?or any api for do that work? – M.B Feb 14 '12 at 21:34
For anyone looking for an answer to the second part of this question (how to get the location for a number), there is a similar question (asked interestingly enough one day before this one) with several answers here:
Telephone area code to city name on iOS
I also discovered an SQLite database named calldata.db
in the private framework AppSupport.framework
that contains US cities, states and area codes, as well as prefixes (the three digits that come after the area code).
Using a query like this you could find out that area code 212 is New York, NY:
SELECT * FROM citycode, npanxx, npa
WHERE npanxx.npa = 212
AND citycode.code = npanxx.rate_center
AND npanxx.npa = npa.npa
I don't however know if accessing/packaging this database would violate any agreements with Apple (I do know that the Default.phoneformat
file from AppSupport.framework
has been packed with several apps which had no problems getting into the App Store, see comments here: https://stackoverflow.com/a/13116227/381233). Perhaps there are some methods in the AppSupport.framework
that would get this information more easily, but that would definitely not be allowed in the app store.
As for the other part of this question (access the details of an incoming call), this would most likely be possible on a jailbroken phone. No doubt there's already a tweak in Cydia that does this.

- 1
- 1

- 2,019
- 24
- 55