ionic-framework - 当应用程序在离子中关闭时如何调用函数
问题描述
我需要帮助,我不知道如何在应用程序关闭时在后台进行函数调用,它只有在打开或最小化时才有效。
platform.ready().then(() => {
this.backgroundMode.setDefaults({ silent: true });
this.backgroundMode.enable();
backgroundMode.on('enable').subscribe(() => {
setInterval(() => {
this.getBusqueda();
}, 5000);
});
解决方案
推荐阅读
- lua - 四变量交换在 Lua 中是如何工作的?
- python - tf.split 操作的逆
- javascript - 上下文保留评估
- python-3.x - 如何将两个数据帧与时间戳索引结合起来,覆盖第一行而不是重复行?
- python - 卷积矩阵的适当展开
- python - Python Openpyxl - 提取多行单元格值以执行拆分
- javascript - 优化分页 REST API 数据的收集
- java - Java 使用 unix 套接字连接到 docker
- python - 如何在 Python 中为软件打包附加组件
- file - UrlDownloadToFileA 从不存在的 Url 下载?