以编程方式获取设备的电话号码 [英] Get the device's phone number programmatically

查看:184
本文介绍了以编程方式获取设备的电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式获取我的iOS设备的电话号码。

I need to get my iOS device's phone number programatically.

通过谷歌我发现此代码:

Via google I found this code:

NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@"SBFormattedPhoneNumber"];
NSLog(@"Phone Number: %@", num);

但在某处我读到如果我使用此代码,Apple会拒绝我的应用。

But somewhere I read that if I use this code, Apple will reject my app.

有没有办法在没有用户输入的情况下获取当前的设备电话号码?

Is there any way to get current device phone number without user entry?

推荐答案

不,该设备的电话号码不能以编程方式提供,并且仍然得到Apple的批准,谢天谢地。我绝对不想要一些我出于好奇心下载的免费应用程序来获取我的电话号码并开始向我发送垃圾短信或让营销人员给我打电话。

No, the device's phone number is not available programmatically and still be approved by Apple, thankfully. I definitely don't want some free app I download out of curiosity to grab my phone number and start sending me spam SMS messages or have marketers calling me.

这篇关于以编程方式获取设备的电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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