简体   繁体   中英

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

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:

@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

You can use this plugin and setInterval() together to run functions in the background of the app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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