mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user