Contact access permission: Ask permission on [ContactsTableViewController viewWillAppear]

This commit is contained in:
manuroe
2017-06-08 08:47:09 +02:00
parent f38e36f013
commit a16f2046b6
@@ -109,7 +109,16 @@
[tracker set:kGAIScreenName value:_screenName];
[tracker send:[[GAIDictionaryBuilder createScreenView] build]];
}
// Check whether the access to the local contacts has not been already asked.
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined)
{
// 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
// ask user permission to access their local contacts.
[MXKAppSettings standardAppSettings].syncLocalContacts = YES;
}
// Observe kAppDelegateDidTapStatusBarNotification.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {