ios - Contact Usage permission request iphone -
my app rejected apple review team. according them reason is
"17.1: apps cannot transmit data user without obtaining user's prior permission , providing user access information how , data used.specifically, app accesses users contacts out requesting permission first"
but, have used **nscontactsusagedescription**
key in info.plst
specify reason of using contacts in app.
what should have additionally permission?
you have ask user whether application can access address book. feature implemented in ios 6.0 , above.
you can try code snippet:
#define system_version_greater_than_or_equal_to(v) ([[[uidevice currentdevice] systemversion] compare:v options:nsnumericsearch] != nsorderedascending)
in - viewwillappear:
// asking access of addressbook // if in ios 6 if (system_version_greater_than_or_equal_to(@"6.0")) { // request authorization address book addressbook_ = abaddressbookcreatewithoptions(null, null); if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusnotdetermined) { abaddressbookrequestaccesswithcompletion(addressbook_, ^(bool granted, cferrorref error) { if (granted == no) { // show alert no contact access } }); } else if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusauthorized) { // user has given access, go } else { // user has denied access // send alert telling user change privacy setting in settings app } } else // ios <= 5 { // contacts directly addressbook_ = abaddressbookcreate(); }
Comments
Post a Comment