0

I'm using the Ionic Background Fetch plugin as it says at https://ionicframework.com/docs/native/background-fetch/ but the issue that I have is that I don't have a way to configure the callback function that should be executed on user's prime time as the doc says.

const config: BackgroundFetchConfig = {
  stopOnTerminate: false, // Set true to cease background-fetch from 
operating after user "closes" the app. Defaults to true.
   };

backgroundFetch.configure(config)
 .then(() => {
     console.log('Background Fetch initialized');

     this.backgroundFetch.finish();

 })
 .catch(e => console.log('Error initializing background fetch', e));

where is supposed to be provided the callback function? the configure function only takes one argument "config" Does anyone could make it to work? Thanks in advance!

gaurrus
  • 111
  • 2
  • 10

1 Answers1

0
const config: BackgroundFetchConfig = {
stopOnTerminate: false, // Set true to cease background-fetch from 
operating after user "closes" the app. Defaults to true.
 };

backgroundFetch.configure(config)
.then(() => {
 console.log('Background Fetch initialized');

HERE

 this.backgroundFetch.finish();

})
.catch(e => console.log('Error initializing background fetch', e));
Specimen
  • 76
  • 11