Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的应用程序中添加一个 CNContactPickerViewController。
用户必须点击一个按钮,然后它就会打开,这样他现在就可以选择一个联系人。
如果用户选择了一个联系人,我的程序将使用它的名字。
我的问题:是否有必要使用 alertView 向用户征求许可?或者我可以只打开 ContactPicker 吗?
使用 CNContactPickerViewController 时无需请求许可。
CNContactPickerViewController 不是您的应用处理的视图控制器。相反,它由操作系统本身处理(通过在您的应用程序中打开联系人应用程序),因此您无法通过代码控制内容。因此,您无需请求许可。
如果您尝试通过 AddressBook 框架访问地址簿,您将需要请求权限,因为您将在代码级别拥有对地址簿的完全访问权限。