Last active
May 15, 2019 21:19
-
-
Save ednilsonamaral/da01b5479d9a10b66581f1cf6fcfd665 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment