【发布时间】:2017-08-23 15:32:28
【问题描述】:
我正在使用 Ionic Background Fetch 插件,正如它在 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” 有没有人可以让它工作? 提前致谢!
【问题讨论】:
标签: ionic-framework background-fetch