transistorsoft / capacitor-background-fetch

Periodic callbacks in the background for both IOS and Android
78 stars 9 forks source link

Information request: execute headless task when app is active? #15

Closed Ryner47 closed 1 year ago

Ryner47 commented 1 year ago

Your Environment

Latest Dependencies: @capacitor/cli: 4.7.1 @capacitor/core: 4.7.1 @capacitor/android: 4.7.1 @capacitor/ios: 4.7.1

Installed Dependencies: @capacitor/ios: not installed @capacitor/core: 4.7.0 @capacitor/cli: 4.7.0 @capacitor/android: 4.7.0

BackgroundFetch.configure({
    minimumFetchInterval: 15,
    stopOnTerminate: false,
    enableHeadless: true,
    startOnBoot: true,
    requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY
},

Context

Hello, I configured the plugin for my android app and it works perfectly in headless mode too.

At this point I would like to ask for a clarification. Considering that:

Is it possible to somehow force the 'BackgroundFetchHeadlessTask' to run even when the app is active or paused? I would like to understand if it is possible in such a way as to centralize the logic only in 'BackgroundFetchHeadlessTask.java' class. Thanks

christocracy commented 1 year ago

Is it possible to somehow force the 'BackgroundFetchHeadlessTask' to run even when the app is active or paused?

No. Headless = app terminated (where your Capacitor JavaScript app no longer exists).