分发adhoc配置文件拒绝访问联系人

时间:2013-03-14 04:03:02

标签: iphone ios objective-c provisioning-profile ios-provisioning

我的发布资料不允许我访问iPhone的联系人,我是否需要获得苹果的特别许可?我的开发人员配置文件运行良好,即它可以访问我的手机的联系人,而分发配置文件否认它。它在ios 5模拟器以及iOS 6模拟器中也在模拟器中运行良好。

提前感谢..

__block BOOL accessGranted = NO;
if (ABAddressBookRequestAccessWithCompletion != NULL) { // we're on iOS 6
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error)          {
    NSLog(@"Error ref %@",error);
    NSLog(@"Access %i",accessGranted);
    accessGranted = granted;
    dispatch_semaphore_signal(sema);
});
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
dispatch_release(sema);
}
else { // we're on iOS 5 or older
addressBook = ABAddressBookCreate();
accessGranted = YES;
}

if (accessGranted) {
//my code
}

0 个答案:

没有答案