简体   繁体   English

我正在尝试安排一个离子cordova背景地理定位插件。这可能吗?

[英]I am trying to schedule an ionic cordova background geolocation plugin.Is it possible?

I am using this below plugin for getting background geolocation from android application, https://github.com/mauron85/cordova-plugin-background-geolocation 我使用下面的插件从android应用程序获取背景地理位置, https://github.com/mauron85/cordova-plugin-background-geolocation

Is there any possible way to somehow stop the plugin after eight hours or schedule it for specific period of time. 是否有任何可能的方法以八小时后以某种方式停止插件或安排它在特定的时间段。 Below is my ionic info, 以下是我的离子信息,

cli packages: cli包:

@ionic/cli-plugin-proxy : 1.4.13
@ionic/cli-utils        : 1.13.1
ionic (Ionic CLI)       : 3.13.1

global packages: 全球套餐:

cordova (Cordova CLI) : 7.1.0

local packages: 本地包裹:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.7.1

System: 系统:

Android SDK Tools : 26.0.2
Node              : v6.10.2
npm               : 5.5.1

One possible way of doing this is to use the background-mode plugin https://www.npmjs.com/package/cordova-plugin-background-mode 一种可行的方法是使用后台模式插件https://www.npmjs.com/package/cordova-plugin-background-mode

You can use this plugin and setInterval() together to run functions in the background of the app. 您可以将此插件和setInterval()一起使用,以在应用程序的后台运行函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM