Why can I access the iPhone address book contacts without being prompted?

左心房为你撑大大i 提交于 2019-12-11 10:18:27

问题


ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, nil);

ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
    NSArray *folks = (__bridge NSArray *)(ABAddressBookCopyArrayOfAllPeople(addressBook));
    NSLog(@"%@",folks);
});

I'm able to access the contacts with no prompt to the user. Opening Settings > Privacy > Contacts I see no entry for my application. (Running in Simulator)


回答1:


The contacts privacy prompt doesn't work on the simulator. Try it on a device.



来源:https://stackoverflow.com/questions/13277249/why-can-i-access-the-iphone-address-book-contacts-without-being-prompted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!