mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Contact access permission: Display "You didn't allow Riot to access your local contacts" instead of "No local contacts" when the user has denied the phonebook permission
This commit is contained in:
parent
71d5131837
commit
4ab0751e56
2 changed files with 25 additions and 1 deletions
|
@ -160,6 +160,8 @@
|
|||
"contacts_address_book_section" = "LOCAL CONTACTS";
|
||||
"contacts_address_book_matrix_users_toggle" = "Matrix users only";
|
||||
"contacts_address_book_no_contact" = "No local contacts";
|
||||
"contacts_address_book_permission_required" = "Permission required to access local contacts";
|
||||
"contacts_address_book_permission_denied" = "You didn't allow Riot to access your local contacts";
|
||||
"contacts_matrix_users_section" = "KNOWN CONTACTS";
|
||||
|
||||
// Chat participants
|
||||
|
|
|
@ -529,7 +529,29 @@
|
|||
}
|
||||
else if (indexPath.section == filteredLocalContactsSection)
|
||||
{
|
||||
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_no_contact", @"Vector", nil);
|
||||
tableViewCell.textLabel.numberOfLines = 0;
|
||||
|
||||
// Indicate to the user why there is no contacts
|
||||
switch (ABAddressBookGetAuthorizationStatus())
|
||||
{
|
||||
case kABAuthorizationStatusAuthorized:
|
||||
// Because there is no contacts on the device
|
||||
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_no_contact", @"Vector", nil);
|
||||
break;
|
||||
|
||||
case kABAuthorizationStatusNotDetermined:
|
||||
// Because the user have not granted the permission yet
|
||||
// (The permission request popup is displayed at the same time)
|
||||
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_permission_required", @"Vector", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
// Because the user didn't allow the app to access local contacts
|
||||
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_permission_denied", @"Vector", nil);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tableViewCell;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue