As far as my understanding, there is no public API available in iPhone SDK to find the users mobile number.
Can we find the mobile number of iPhone user using the Core telephony framework added in 4.0 SDK?
As far as my understanding, there is no public API available in iPhone SDK to find the users mobile number.
Can we find the mobile number of iPhone user using the Core telephony framework added in 4.0 SDK?
No, the CoreTelephony framework provides some basic information about the carrier and limited info about calls, not much else.
The limited information includes things like the amount of current active calls, the call ID (not a mobile number, just a unique ID that the OS uses to track the particular call) and the state of a call, like whether the call is on hold or not.
The main feature in CallTelephony is an API to check whether or not a carrier allows VoIP over 3G.
Yes, you can, but it's tricky. It involves using iOS private API, which will determine Apple to reject your app in case you want to post it on the App Store.
Here's what I did:
in the command line go to this folder: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/CoreTelephony.framework and perform the following command:
class-dump CoreTelephony > CoreTelephony.h
This will create a header file in the current directory. Move this file in the desired directory.
at the end of the CoreTelephony.h file, add the following:
extern NSString *CTSettingCopyMyPhoneNumber();
in case you have linking errors, use the following linking flags in the build settings of your project target:
-force_flat_namespace
-undefined suppress
(Xcode 4: click on the project target -> Build Settings tab -> Linking -> double-click on the values section of the Other Linker Flags property -> + -> add flags above -> Done
if u want to get cell phone number from call log then see this link it may be helpful. But i am not sure that after using this apple will aprove ur app. call details