Skip to content

patrickjquinn/capacitor-background-mode

 
 

Repository files navigation

@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>
Param Type
settings Partial<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>


isIgnoringBatteryOptimizations()

isIgnoringBatteryOptimizations() => Promise<{ isIgnoring: boolean; }>

Returns: Promise<{ isIgnoring: boolean; }>


disableBatteryOptimizations()

disableBatteryOptimizations() => Promise<void>

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
Param Type
eventName 'appInBackground'
listenerFunc () => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener('appInForeground', ...)

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

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

ISettings

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'

PermissionStatus

Prop Type
display PermissionState

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

Partial

Make all properties in T optional

{ [P in keyof T]?: T[P]; }

PermissionState

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 73.3%
  • TypeScript 9.8%
  • JavaScript 8.5%
  • Swift 2.9%
  • HTML 2.2%
  • Ruby 1.9%
  • Other 1.4%