首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >背景提取离子组态

背景提取离子组态
EN

Stack Overflow用户
提问于 2017-08-23 15:32:28
回答 1查看 1.2K关注 0票数 0

我正在使用Ionic背景提取插件,就像它在https://ionicframework.com/docs/native/background-fetch/上说的那样,但是我的问题是,我没有办法配置应该在用户黄金时间执行的回调函数,就像文档说的那样。

代码语言:javascript
复制
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“,任何人都可以让它工作吗?提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2017-11-21 15:09:51

代码语言:javascript
复制
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');

这里

代码语言:javascript
复制
 this.backgroundFetch.finish();

})
.catch(e => console.log('Error initializing background fetch', e));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45843942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档