gpt4 book ai didi

iphone - 联系人使用权限请求 iphone

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:30:01 25 4
gpt4 key购买 nike

我的应用程序被 apple 审核团队拒绝了。据他们说原因是

"17.1: Apps cannot transmit data about a user without obtaining the user's prior permission and providing the user with access to information about how and where the data will be used.Specifically, your app accesses the Users contacts with out requesting permission first"

但是,我在我的 info.plst 中使用了 **NSContactsUsageDescription** 键来指定在我的应用中使用联系人的原因。

我还需要做什么才能获得许可?

最佳答案

在 iOS 6 中,您需要使用地址簿权限请求 iphone 才能访问它的设备联系人:-

enter image description here

本例代码实现方法:

ABAddressBookRef addressBook;
if ([self isABAddressBookCreateWithOptionsAvailable]) {
CFErrorRef error = nil;
addressBook = ABAddressBookCreateWithOptions(NULL,&error);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
// callback can occur in background, address book must be accessed on thread it was created on
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {

} else if (!granted) {


} else {
// access granted
[self GetAddressBook];


}
});
});
} else {
// iOS 4/5

[self GetAddressBook];
}

关于iphone - 联系人使用权限请求 iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17962730/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com