-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback onHeartbeat never fires #177
Comments
Forgot to add part of the code where I start / stop tracking. static Future start() async {
bg.State state = await bg.BackgroundGeolocation.state;
if (!state.enabled) {
log.FLog.debug(text: 'Starting location service...');
await bg.BackgroundGeolocation.start();
log.FLog.debug(text: 'Location service started...');
}
}
static Future stop() async {
bg.State state = await bg.BackgroundGeolocation.state;
if (state.enabled) {
log.FLog.debug(text: 'Stopping location service...');
await bg.BackgroundGeolocation.stop();
await bg.BackgroundGeolocation.removeListeners();
log.FLog.debug(text: 'Location service stopped...');
}
} Location tracking works like a charm, all good. Other callbacks |
Why do you This is like disconnecting your speaker wires when you turn off your stereo. This is probably your problem. When you call |
Hmm. Good catch. I was removing listener but not re-attaching them on start but on initialize only. It may be the cause of the issue... Will retest tomorrow and post results. Thanks. |
Just don’t removeListeners. |
Yep. Will try. It is very old line... I refactored the rest but it was left there somehow. And the more you look the less you see as usual. Thanks once again. Will get back to you with results. |
BTW, not to open new issue. I have a problem with notification icon. It works normally on test device with |
No idea about icon. Likely something on your end. |
It seems that removing Would you mind checking the icon issue. Should I open new issue? My quick guess is that release configuration is not good but I am definitely not an expert in gradle things. Here is my release build configuration:
|
Callback
onHeartbeat
never fires.Your Environment
flutter doctor
):Expected Behavior
onHeartbeat
callback should fire.Actual Behavior
onHeartbeat
callback never fires.Context
I am trying to force app to report to the server once in 5 minutes even if it is not moving. Heartbeat event should be the one I need since it should fire in foreground as well as in the headless mode according to my understanding of the docs.
I see periodically
HeartbeatService$a run
andHeartbeatService onDestroy
logged but my callback is not being fired.Debug logs
Logs
The text was updated successfully, but these errors were encountered: