如何访问通讯簿中的当前用户记录? [英] How do you access the current user's record in Address Book?

查看:158
本文介绍了如何访问通讯簿中的当前用户记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

地址簿API中是否有方法可以编程访问当前用户的记录?换句话说,如果这个iPhone属于约翰·史密斯,得到的联系人记录是约翰·史密斯(无论哪个记录在联系人中标记为我)?

Is there a way in the Address Book API to access the current user's record programatically? In other words, if this iPhone belongs to John Smith, to get the contact record that is John Smith (whichever record is marked as Me in Contacts)?

显然,您可以弹出选择器,让用户从其联系人中选择自己,但这对用户来说似乎是一个不必要的操作。

Obviously you can popup the picker and let the user select themselves from their Contacts, but this seems like an unnecessary action for the user to take.

使用案例:我在我的应用程序中有一个表单,我想根据他们已经输入的联系信息为用户预填充表单。这将是更好的只是显示这些为他们,让他们通过他们的所有联系人和选择自己。

Use case: I have a form in my app and I'd like to pre-populate the form for the user based on their contact info they've already entered. It would be nicer to just display this for them than make them go through all of their contacts and select themselves.

推荐答案

无法访问用户通讯簿卡。原因是,苹果不希望应用程序有能力看到潜在的个人信息,而无需用户首先授予应用访问该信息。

There is no access to the users address book card. The reason is that Apple don't want apps to have the ability to see potentially personal information without the user first giving the app access to that information.

我,一个,不希望应用程序能够从我的卡读取我的电子邮件地址,电话号码和家庭地址,并做它喜欢它,除非我说它可以在第一位。

I, for one, would not want an app to be able to read my email address, phone number, and home address from my card and do what it pleases with it unless I said it could in the first place.

因此,您必须向用户显示地址簿选择器,并允许他们选择他们的地址簿条目。

For that reason, you will have to present the user with the address book picker and allow them to select their address book entry.

这篇关于如何访问通讯簿中的当前用户记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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