Capacitor plugin for audio mode toggle
npm install capacitor-plugin-audio-toggle
npx cap sync
enable()
disable()
reset()
selectDevice(...)
setRingtoneMode()
getAvailableDevices()
getSelectedDevice()
checkPermissions()
requestPermissions()
isBluetoothEnabled()
openBluetoothSettings()
openAppSettings()
addListener('onChanges', ...)
removeAllListeners()
- Interfaces
- Type Aliases
enable() => Promise<void>
disable() => Promise<void>
reset() => Promise<void>
selectDevice(data: { device: DeviceName; }) => Promise<void>
Param | Type |
---|---|
data |
{ device: DeviceName; } |
setRingtoneMode() => Promise<void>
getAvailableDevices() => Promise<{ earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; }>
Returns: Promise<{ earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; }>
getSelectedDevice() => Promise<{ selectedDevice: DeviceName; }>
Returns: Promise<{ selectedDevice: DeviceName; }>
checkPermissions() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
requestPermissions() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
isBluetoothEnabled() => Promise<{ enabled: boolean; }>
Returns: Promise<{ enabled: boolean; }>
openBluetoothSettings() => Promise<void>
openAppSettings() => Promise<void>
addListener(eventName: 'onChanges', listenerFunc: (data: { earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; selectedDevice: DeviceName; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName |
'onChanges' |
listenerFunc |
(data: { earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; selectedDevice: DeviceName; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners() => Promise<void>
Prop | Type |
---|---|
remove |
() => Promise<void> |
'earpiece' | 'speakerphone' | 'wired' | 'bluetooth'