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
+2 -1
View File
@@ -14,6 +14,7 @@
limitations under the License.
*/
#import <Contacts/Contacts.h>
#import "PeopleViewController.h"
#import "UIViewController+RiotSearch.h"
@@ -99,7 +100,7 @@
[super viewWillAppear:animated];
// 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