mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Contact access permission: make it work again.
Ask the permission when the user displays the people tab.
This commit is contained in:
parent
9d10dbfc10
commit
71d5131837
2 changed files with 12 additions and 10 deletions
|
@ -81,15 +81,8 @@
|
|||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onContactManagerDidUpdate:) name:kMXKContactManagerDidUpdateLocalContactsNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onContactManagerDidUpdate:) name:kMXKContactManagerDidUpdateLocalContactMatrixIDsNotification object:nil];
|
||||
|
||||
// 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;
|
||||
}
|
||||
else
|
||||
// Refresh the matrix identifiers for all the local contacts.
|
||||
if (ABAddressBookGetAuthorizationStatus() != kABAuthorizationStatusNotDetermined)
|
||||
{
|
||||
// Refresh the matrix identifiers for all the local contacts.
|
||||
[[MXKContactManager sharedManager] updateMatrixIDsForAllLocalContacts];
|
||||
|
|
|
@ -100,7 +100,16 @@
|
|||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
[AppDelegate theDelegate].masterTabBarController.navigationItem.title = NSLocalizedStringFromTable(@"title_people", @"Vector", nil);
|
||||
[AppDelegate theDelegate].masterTabBarController.navigationController.navigationBar.tintColor = kRiotColorOrange;
|
||||
[AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = kRiotColorOrange;
|
||||
|
|
Loading…
Reference in a new issue