Capacitor plugin to perform infinite background execution
This plugin was replaced with @anuradev/capacitor-background-mode
npm install capacitor-plugin-background-mode
npx cap sync
enable()
disable()
getSettings()
setSettings(...)
checkForegroundPermission()
requestForegroundPermission()
isIgnoringBatteryOptimizations()
disableBatteryOptimizations()
enableWebViewOptimizations()
disableWebViewOptimizations()
moveToBackground()
moveToForeground()
isScreenOff()
isEnabled()
isActive()
wakeUp()
unlock()
addListener('appInBackground', ...)
addListener('appInForeground', ...)
removeAllListeners()
- Interfaces
- Type Aliases
enable() => Promise<void>
disable() => Promise<void>
getSettings() => Promise<{ settings: ISettings; }>
Returns: Promise<{ settings: ISettings; }>
setSettings(settings: Partial<ISettings>) => Promise<void>
Param | Type |
---|---|
settings |
Partial<ISettings> |
checkForegroundPermission() => Promise<{ enabled: boolean; }>
Returns: Promise<{ enabled: boolean; }>
requestForegroundPermission() => Promise<void>
isIgnoringBatteryOptimizations() => Promise<{ isIgnoring: boolean; }>
Returns: Promise<{ isIgnoring: boolean; }>
disableBatteryOptimizations() => Promise<void>
enableWebViewOptimizations() => Promise<void>
disableWebViewOptimizations() => Promise<void>
moveToBackground() => Promise<void>
moveToForeground() => Promise<void>
isScreenOff() => Promise<{ isScreenOff: boolean; }>
Returns: Promise<{ isScreenOff: boolean; }>
isEnabled() => Promise<{ enabled: boolean; }>
Returns: Promise<{ enabled: boolean; }>
isActive() => Promise<{ activated: boolean; }>
Returns: Promise<{ activated: boolean; }>
wakeUp() => Promise<void>
unlock() => Promise<void>
addListener(eventName: 'appInBackground', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName |
'appInBackground' |
listenerFunc |
() => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'appInForeground', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName |
'appInForeground' |
listenerFunc |
() => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners() => Promise<void>
Prop | Type |
---|---|
title |
string |
text |
string |
subText |
string |
bigText |
boolean |
resume |
boolean |
silent |
boolean |
hidden |
boolean |
color |
string |
icon |
string |
channelName |
string |
channelDescription |
string |
allowClose |
boolean |
closeIcon |
string |
closeTitle |
string |
showWhen |
boolean |
disableWebViewOptimization |
boolean |
visibility |
'public' | 'private' | 'secret' |
Prop | Type |
---|---|
remove |
() => Promise<void> |
Make all properties in T optional
{
[P in keyof T]?: T[P];
}