Building apps at a large company? Check out Ionic Enterprise

Mobile Accessibility

Improve this doc

This plugin exposes information on the status of various accessibility features of mobile operating systems, including, for example, whether a screen reader is running, invert colors is enabled, and the preferred scaling for text. It also allows an application to send a string to be spoken by the screen reader, or a command to stop the screen reader from speaking.

Repo: https://github.com/phonegap/phonegap-mobile-accessibility

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add phonegap-plugin-mobile-accessibility
    $ npm install --save @ionic-native/mobile-accessibility
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { MobileAccessibility } from 'ionic-native';


constructor(private mobileAccessibility: MobileAccessibility) { }

...

if(this.mobileAccessibility.isScreenReaderRunningCallback();

Instance Members

MobileAccessibilityNotifications

isScreenReaderRunning()

Makes an asynchronous call to native MobileAccessibility to determine if a screen reader is running.

Returns: Promise<boolean> A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.

isVoiceOverRunningCallback()

Platforms:iOS 

An iOS-specific proxy for the MobileAccessibility.isScreenReaderRunning method

Returns: Promise<boolean> A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.

isTalkBackRunningCallback()

Platforms:Amazon Fire OS Android 

An Android/Amazon Fire OS-specific proxy for the MobileAccessibility.isScreenReaderRunning method.

Returns: Promise<boolean> A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.

isChromeVoxActive()

Platforms:Amazon Fire OS Android 

On Android, this method returns true if ChromeVox is active and properly initialized with access to the text to speech API in the WebView. If TalkBack is running but ChromeVox is not active, this method is useful to alert the user of a potential problem.

Returns: Promise<boolean> Returns the result

isBoldTextEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isClosedCaptioningEnabledCallback()

Returns: Promise<boolean> Returns the result

isDarkerSystemColorsEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isGrayscaleEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isGuidedAccessEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isInvertColorsEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isMonoAudioEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isReduceMotionEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isReduceTransparencyEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isSpeakScreenEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isSpeakSelectionEnabledCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isSwitchControlRunningCallback()

Platforms:iOS 

Returns: Promise<boolean> Returns the result

isTouchExplorationEnabledCallback()

Platforms:Amazon Fire OS Android 

Returns: Promise<boolean> Returns the result

getTextZoomCallback()

setTextZoom(textZoom)

Param Type Details
textZoom number

A percentage value by which text in the WebView should be scaled.

updateTextZoom()

usePreferredTextZoom(value)

A Boolean value which specifies whether to use the preferred text zoom of a default percent value of 100.

Param Type Details
value boolean

Returns the result

postNotification(mobileAccessibilityNotification, value)

Platforms:iOS 

Posts a notification with a string for the screen reader to announce if it is running.

Param Type Details
mobileAccessibilityNotification any
value string

A string to be announced by a screen reader.

Returns: Promise<boolean> Returns the result

speak(value, queueMode, properties)

Speaks a given string through the screenreader. On Android, if ChromeVox is active, it will use the specified queueMode and properties.

Param Type Details
value string
queueMode mumber
properties any

stop()

Stops speech.

API

Native

General