Is it possible to detect a phone number of the dev

2019-07-03 23:23发布

I have bunch of customers' phone number information with their profile in my database.

What I'm planning to do is that an iPhone searches for matching phone number and its customer's profile in my database as soon as the application runs. And it displays the customer profile on the screen.

The problem is.. I was told that iOS 4.x allowed this before... but not anymore after that version :S Can I still access to the device information and get its number? If yes, how?

2条回答
相关推荐>>
2楼-- · 2019-07-03 23:38

You can use CTSettingCopyMyPhoneNumber() from CoreTelephony.framework

extern NSString* CTSettingCopyMyPhoneNumber();
NSString *phone = CTSettingCopyMyPhoneNumber();
NSLog(@"Phone : %@", phone);
查看更多
再贱就再见
3楼-- · 2019-07-04 00:02

Nope. Not in a way it would be accepted by the iTunes store. You did your research and it is where it ends. The only way you can get it is by asking the user to enter the phone number during the app's first run and probably cross check it with the database you already have.

查看更多
登录 后发表回答