7.2.1 • Published 6 months ago

@anuradev/capacitor-background-mode v7.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months 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(settings: Partial<ISettings>) => Promise<void>
ParamType
settingsPartial<ISettings>

disable()

disable() => Promise<void>

updateNotification(...)

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

checkNotificationsPermission()

checkNotificationsPermission() => Promise<NotificationPermissionStatus>

Returns: Promise<NotificationPermissionStatus>


requestNotificationsPermission()

requestNotificationsPermission() => Promise<NotificationPermissionStatus>

Returns: Promise<NotificationPermissionStatus>


checkMicrophonePermission()

checkMicrophonePermission() => Promise<MicrophonePermissionStatus>

Returns: Promise<MicrophonePermissionStatus>


requestMicrophonePermission()

requestMicrophonePermission() => Promise<MicrophonePermissionStatus>

Returns: Promise<MicrophonePermissionStatus>


checkBatteryOptimizations()

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

Returns: Promise<{ enabled: boolean; }>


requestDisableBatteryOptimizations()

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

Returns: Promise<{ enabled: 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>
ParamType
eventName'appInBackground'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>


addListener('appInForeground', ...)

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

Returns: Promise<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'

NotificationPermissionStatus

PropType
notificationsPermissionState

MicrophonePermissionStatus

PropType
microphonePermissionState

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'

6.0.0

11 months ago

7.0.0

11 months ago

7.0.4

9 months ago

7.2.1

6 months ago

7.0.3

10 months ago

7.2.0

7 months ago

7.0.2

10 months ago

7.1.0

9 months ago

7.0.1

10 months ago

3.1.0

12 months ago

3.0.0

12 months ago

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

3 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

3 years ago

1.1.0

3 years ago

2.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago