Mobile Accessibility
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
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add phonegap-plugin-mobile-accessibility $ npm install --save @ionic-native/mobile-accessibility@4
- Add this plugin to your app's module
Supported platforms
- Android Fire OS
- Android
- iOS
- Windows
Usage
import { MobileAccessibility } from '@ionic-native/mobile-accessibility';
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.
isVoiceOverRunning()
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.
isTalkBackRunning()
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
isBoldTextEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isClosedCaptioningEnabled()
Returns: Promise<boolean>
Returns the result
isDarkerSystemColorsEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isGrayscaleEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isGuidedAccessEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isInvertColorsEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isMonoAudioEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isReduceMotionEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isReduceTransparencyEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isSpeakScreenEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isSpeakSelectionEnabled()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isSwitchControlRunning()
Platforms:iOS
Returns: Promise<boolean>
Returns the result
isTouchExplorationEnabled()
Platforms:Amazon Fire OS Android
Returns: Promise<boolean>
Returns the result
getTextZoom()
- @returns {Promise
} Returns the result
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.