2.0.8 • Published 2 years ago

@anuradev/capacitor-background-mode v2.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@anuradev/capacitor-background-mode

Capacitor plugin to enable background mode

This plugin replace to capacitor-plugin-background-mode

Install

npm install @anuradev/capacitor-background-mode
npx cap sync

API

enable()

enable() => Promise<void>

disable()

disable() => Promise<void>

getSettings()

getSettings() => Promise<{ settings: ISettings; }>

Returns: Promise<{ settings: ISettings; }>


setSettings(...)

setSettings(settings: Partial<ISettings>) => Promise<void>
ParamType
settingsPartial<ISettings>

checkForegroundPermission()

checkForegroundPermission() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestForegroundPermission()

requestForegroundPermission() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


checkNotificationsPermission()

checkNotificationsPermission() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestNotificationsPermission()

requestNotificationsPermission() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


checkBatteryOptimizations()

checkBatteryOptimizations() => Promise<{ disabled: boolean; }>

Returns: Promise<{ disabled: boolean; }>


requestDisableBatteryOptimizations()

requestDisableBatteryOptimizations() => Promise<{ disabled: boolean; }>

Returns: Promise<{ disabled: boolean; }>


enableWebViewOptimizations()

enableWebViewOptimizations() => Promise<void>

disableWebViewOptimizations()

disableWebViewOptimizations() => Promise<void>

moveToBackground()

moveToBackground() => Promise<void>

moveToForeground()

moveToForeground() => Promise<void>

isScreenOff()

isScreenOff() => Promise<{ isScreenOff: boolean; }>

Returns: Promise<{ isScreenOff: boolean; }>


isEnabled()

isEnabled() => Promise<{ enabled: boolean; }>

Returns: Promise<{ enabled: boolean; }>


isActive()

isActive() => Promise<{ activated: boolean; }>

Returns: Promise<{ activated: boolean; }>


wakeUp()

wakeUp() => Promise<void>

unlock()

unlock() => Promise<void>

addListener('appInBackground', ...)

addListener(eventName: 'appInBackground', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName'appInBackground'
listenerFunc() => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener('appInForeground', ...)

addListener(eventName: 'appInForeground', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName'appInForeground'
listenerFunc() => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

ISettings

PropType
titlestring
textstring
subTextstring
bigTextboolean
resumeboolean
silentboolean
hiddenboolean
colorstring
iconstring
channelNamestring
channelDescriptionstring
allowCloseboolean
closeIconstring
closeTitlestring
showWhenboolean
disableWebViewOptimizationboolean
visibility'public' | 'private' | 'secret'

PermissionStatus

PropType
displayPermissionState

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

Partial

Make all properties in T optional

{ P in keyof T?: TP; }

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

2.0.7

2 years ago

2.0.8

2 years ago

1.1.5

2 years ago

2.0.6

2 years ago

1.1.1

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

1.1.0

2 years ago

2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago