我正在使用Ionic背景提取插件,就像它在https://ionicframework.com/docs/native/background-fetch/上说的那样,但是我的问题是,我没有办法配置应该在用户黄金时间执行的回调函数,就像文档说的那样。
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));应该在哪里提供回调函数?配置函数只需要一个参数"config“,任何人都可以让它工作吗?提前感谢!
发布于 2017-11-21 15:09:51
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));https://stackoverflow.com/questions/45843942
复制相似问题