replace contact availability checks with the iOS 9+ way

This commit is contained in:
fridtjof
2019-02-05 01:36:13 +01:00
parent 97c4f5dfde
commit 245de393e2
4 changed files with 11 additions and 7 deletions
@@ -15,6 +15,7 @@
limitations under the License.
*/
#import <Contacts/Contacts.h>
#import "ContactsTableViewController.h"
#import "UIViewController+RiotSearch.h"
@@ -148,7 +149,7 @@
[[Analytics sharedInstance] trackScreen:_screenName];
// Check whether the access to the local contacts has not been already asked.
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined)
if ([CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] != CNAuthorizationStatusNotDetermined)
{
// Allow by default the local contacts sync in order to discover matrix users.
// This setting change will trigger the loading of the local contacts, which will automatically