Mobile Accessibility Guidelines - Notifications

Standard operating system notifications should


Standard operating system notifications should be used where available and appropriate.


Standard operating system (OS) methods for alerts and messages can often be more accessible than something custom made, in particular for users of assistive technology. This is because standard controls:

  • have traits that are understood by assistive technology such as screen readers,
  • generally appear in a consistent location, and
  • follow the user-defined options for font and colour.

App level and browser level errors and alerts should use operating system methods of notification. However, page/screen or content level errors and alerts may use either OS or custom notifications. Custom notifications must be perceivable.


iOS

Use a UIAlertController to display a message box dialog that contains the error message.

iOS Example (Objective-C)

UIAlertView *messageBox = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"Error") message: NSLocalizedString(@"You must enter an email address") delegate:nil cancelButtonTitle: NSLocalizedString(@"OK") otherButtonTitles:nil];
[messageBox show];

Android

Use the AlertDialog to display error messages. As long as this is used, error messages and their associated functions will be accessible.

Android Pass Example

//Use an Android standard alert dialog to display error messages
AlertDialog.Builder builder = new AlertDialog.Builder(this);
 
builder.setMessage(//Error Message String)
builder.setCancelable(true);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int id) {
        dialog.cancel();
    }
});
AlertDialog alert = builder.create(); 
alert.show();

HTML

A JavaScript alert is one option for HTML to meet this standard.

HTML Pass Example

<script>
    alert('Status message');
</script>

Testing

Procedures

  1. Activate a screen reader.
  2. Trigger an alert or error on at the app level e.g.
    • Time out,
    • Update notice,
    • Error contacting the server,
    • Other app level errors or alerts.
  3. Verify that the alerts or error notifications are announced by assistive technologies.

Outcome

The following check is true:

  • The app uses operating system standard methods for providing app level or non-action triggered alerts and indicating errors to users which are announced by assistive technologies.