How to programmatically get phone number with iOS11 for Enterprise app

3.1k Views Asked by At

Yes I know full well its not possible to get the phone number using public APIs.

I want to know what the latest situation is regarding how to get the phone number using private APIs for an enterprise app with iOS11. All the past questions I could find are years old, couldn't find anything recent.

I tried this:

extern NSString* CTSettingCopyMyPhoneNumber();
+(NSString *) phoneNumber
{
    NSString *phone = CTSettingCopyMyPhoneNumber();
    return phone;
}

But am not able to run this however as I wasn't able to add the com.apple.coretelephony.Identity.get entitlement without getting a signing error saying the executable was signed with invalid entitlements.

Is it still possible with iOS 11 to get the phone number programmatically using non-public APIs for an enterprise app on a non jailbroken device?

0

There are 0 best solutions below