iOS 6 Address Book not working?

前端 未结 4 1573
逝去的感伤
逝去的感伤 2020-12-03 00:19

My method of programmatically retrieving e-mail addresses from the Address Book no longer seems to work on iOS 6 devices. It worked in iOS 5 and oddly, still works in the iO

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 00:40

    Probably related to the new privacy controls—as of iOS 6, on the device, an app can’t access the user’s contacts without their permission. From the documentation:

    On iOS 6.0 and later, if the caller does not have access to the Address Book database:

    • For apps linked against iOS 6.0 and later, this function returns NULL.

    • For apps linked against previous version of iOS, this function returns an empty read-only database.

    If you haven’t seen the permissions alert come up (“SomeApp would like access to your contacts”), it’s possible that the direct address-book APIs just assume that they don’t have access and silently fail; you might have to display something from the AddressBookUI framework to trigger it.

提交回复
热议问题