const init = () => {
BackgroundGeolocation.initialize({
notificationText: "Your app is running, tap to open.",
notificationTitle: "App Running",
updateInteval: 10000,
requestedAccuracy: 102,
// Small icon has to be in 'drawable' resources of your app
// if you does not provide one (or it is not found) a fallback icon will be used.
smallIcon: "ic_small_icon",
// Start getting location updates right away. You can set this to false or not set at all (se below).
startImmediately: false,
})
BackgroundGeolocation.addListener("onPermissions", (data: BgPermissions) => {
console.log("BGLocation permissions:", data)
// Do something with data
})
}
There is also a single toggle button which stops and starts the service when toggling.
To Reproduce
Steps to reproduce the behavior:
Launch the application.
Go to device inspector in the browser and check the logs.
Go to the button in the application and do click on it (check the logs).
Do click in the button again and see how the service is stoped.
Expected behavior
It shouldn't start till the user do click in the button(which starts the service).
Screenshots
The next is a screenshot from the debug console(i'm using device inspector to see logs from an emulator):
As you can follow, before to user clicking on the button(to start the service) the console already is showing a task is being launched by the service.
Then, when user clicks the first time it continue running, and when it does click again the service is stoped, to be re activated by a new click and deactivated again.
Due to this behaviour I think, even when there is a condition to breaks if the service was not started, adding a new listener on location will start the service, but why?
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version 0.1.1
Smartphone (please complete the following information):
Hi,
I'm initializing this plugin with the application itself and later i add a new Listener as follows:
The initialization function is as follows:
There is also a single toggle button which stops and starts the service when toggling.
To Reproduce Steps to reproduce the behavior:
Expected behavior It shouldn't start till the user do click in the button(which starts the service).
Screenshots The next is a screenshot from the debug console(i'm using device inspector to see logs from an emulator): As you can follow, before to user clicking on the button(to start the service) the console already is showing a task is being launched by the service. Then, when user clicks the first time it continue running, and when it does click again the service is stoped, to be re activated by a new click and deactivated again.
Due to this behaviour I think, even when there is a condition to breaks if the service was not started, adding a new listener on location will start the service, but why?
Desktop (please complete the following information):
Smartphone (please complete the following information):