This plugin ensures you can execute background processes such native when app is suspended
npm install capacitor-background-interval-process
npx cap sync
isProcessAlive()
startProcess(...)
terminateProcess()
addListener(...)
removeAllListeners()
- Interfaces
isProcessAlive() => Promise<IIsProcessAlive>
Returns: Promise<IIsProcessAlive>
startProcess(option: IStartOptions) => Promise<void>
Param | Type |
---|---|
option |
IStartOptions |
terminateProcess() => Promise<void>
addListener(eventName: 'DOIT', callback: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName |
"DOIT" |
callback |
() => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners() => Promise<void>
Prop | Type |
---|---|
status |
boolean |
Prop | Type |
---|---|
interval |
number |
title |
string |
description |
string |
Prop | Type |
---|---|
remove |
() => Promise<void> |
ANDROID
And add xmlns:tools="http://schemas.android.com/tools"
to AndroidManifest.xml
And add to android/app/build.gradle
android {
configurations.all {
resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' }
}
}
## TODO IMPROVEMENTS FOR THE ALL PLATFORMS