Capacitor plugin to enable background mode
This plugin replace to capacitor-plugin-background-mode
npm install @anuradev/capacitor-background-mode
npx cap sync
Promise<{ settings: ISettings; }>
--------------------
### setSettings(...)
```typescript
setSettings(settings: PartialPartial<ISettings>
|
--------------------
### checkForegroundPermission()
```typescript
checkForegroundPermission() => PromisePromise<PermissionStatus>
--------------------
### requestForegroundPermission()
```typescript
requestForegroundPermission() => PromisePromise<PermissionStatus>
--------------------
### checkNotificationsPermission()
```typescript
checkNotificationsPermission() => PromisePromise<PermissionStatus>
--------------------
### requestNotificationsPermission()
```typescript
requestNotificationsPermission() => PromisePromise<PermissionStatus>
--------------------
### checkBatteryOptimizations()
```typescript
checkBatteryOptimizations() => Promise<{ disabled: boolean; }>
```
**Returns:** Promise<{ disabled: boolean; }>
--------------------
### requestDisableBatteryOptimizations()
```typescript
requestDisableBatteryOptimizations() => Promise<{ disabled: boolean; }>
```
**Returns:** Promise<{ disabled: boolean; }>
--------------------
### enableWebViewOptimizations()
```typescript
enableWebViewOptimizations() => PromisePromise<{ isScreenOff: boolean; }>
--------------------
### isEnabled()
```typescript
isEnabled() => Promise<{ enabled: boolean; }>
```
**Returns:** Promise<{ enabled: boolean; }>
--------------------
### isActive()
```typescript
isActive() => Promise<{ activated: boolean; }>
```
**Returns:** Promise<{ activated: boolean; }>
--------------------
### wakeUp()
```typescript
wakeUp() => Promise'appInBackground'
|
| **`listenerFunc`** | () => void
|
**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
### addListener('appInForeground', ...)
```typescript
addListener(eventName: 'appInForeground', listenerFunc: () => void) => Promise'appInForeground'
|
| **`listenerFunc`** | () => void
|
**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
### removeAllListeners()
```typescript
removeAllListeners() => Promisestring
|
| **`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'