Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.platform.ready().then(() => {
- // Ativando backgroundMode
- cordova.plugins.backgroundMode.enable();
- // BackgroundMode em segundo plano
- cordova.plugins.backgroundMode.on('activate', () => {
- this.backgroundMode.disableWebViewOptimizations();
- setInterval(() => {
- // Iniciando leitura da Position do usuario enquanto estiver em backgroundMode
- this.locationTrackerProvider.startTracking();
- }, 60000);
- });
- // BackgroundMode quando o app estiver fechado
- cordova.plugins.backgroundMode.on('deactivate', () => {
- setInterval(() => {
- // Iniciando leitura da Position do usuario enquanto estiver em backgroundMode
- this.locationTrackerProvider.startTracking();
- }, 60000);
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement