IOS6.0 的settings/privacy/contacts没有出现自己的APP
来源:互联网 发布:java单例模式线程安全 编辑:程序博客网 时间:2024/04/29 06:19
在stack上找的答案:
That did the perfect trick for me!
On iOS6, apple introduce new privacy control, user can control the accessment of contact and calender by each app. So, in the code side, you need to add some way to request the permission. In iOS5 or before, we can always call
ABAddressBookRef addressBook = ABAddressBookCreate();
to get the addressbook without any problem, but in iOS6, if you don't have permission, this call will just return empty pointer. That why we need to change the method to get ABAddressBookRef.
__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) { accessGranted = granted; dispatch_semaphore_signal(sema); }); dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); dispatch_release(sema); }else { // we're on iOS 5 or older accessGranted = YES;}if (accessGranted) { // Do whatever you want here.}
In the code,semaphore is used for blocking until response, while ABAddressBookRequestAccessWithCompletion will ask for permission if the app didn't ask before. Otherwise it will just follow the settings in Settings-Privacy-Contact.
SOURCE: http://programmerjoe.blogspot.com/2012/10/ios6-permissions-contacts.html
第二点info.list里面有一项Privacy-Contacts Usage Description 加上去
oK,解决~
- IOS6.0 的settings/privacy/contacts没有出现自己的APP
- iOS6.0以后App对内存警告的处理
- IOS6.0以后APP对内存警告的处理
- IOS6.0以后APP对内存警告的处理
- IOS6.0以后APP对内存警告的处理
- IOS6.0以后APP对内存警告的处理
- IOS6.0以后APP对内存警告的处理
- 在简体中文键盘输入时出现ios6.0的bug
- iOS9.0 Contacts/Contacts.h的使用 联系人操作
- Ubuntu 14.04 没有system settings的解决方法
- Ubuntu 14.04 没有system settings的解决办法
- 没有自己的东西
- Android Contacts的使用
- 如何让ios7的app同时适应ios6,即ios6与ios7的适配问题
- 在facebook上做app, 需要提交privacy policy url的解决办法
- iOS6:在你的App内使用Passbook
- 让app在ios6上具有ios7的扁平效果
- 让app在ios6上具有ios7的扁平效果
- POJ 3667 hotel 和 NYOJ 537 hotel 【线段树之区间合并】
- IOS类似9.png
- Google、苹果与三星各自的创新路径
- HTTP Header详解
- UISlider的样式和滑块自定义
- IOS6.0 的settings/privacy/contacts没有出现自己的APP
- JAVA.SWT/JFace: JFace篇之JFace对话框以及日历DateTime控件
- 插入失效
- 黑马程序员_C#面向对象知识总结3
- 推荐数 Top 10的书
- request.getAttribute和getParameter区别
- 一点关于位图的心得----CreateBitmap与CreatDIBSection比较
- Cocos2d-x学习之 整体框架描述
- Cocos2d-x 学习之引擎介绍