Comments (14)
That's the point of using this library, it will continue to run and get location updates in background no matter what. For stopping this you have to call BackgroundLocator.unRegisterLocationUpdate()
.
from background_locator.
I know and that's perfect.
I added the BackgroundLocator.unRegisterLocationUpdate() to the dispose function of my app but when I close the app, the location is still tracked.
I have to force kill the app to stop it.
from background_locator.
It might be a bug in the library, I Will check it. But Please be sure that dispose()
function is getting called.
from background_locator.
Ok thanks
Otherwise, is it something to put in the application class?
from background_locator.
I ran the example app and the start stop buttons worked as expected without any problem, Please be sure that your dispose()
method and BackgroundLocator.unRegisterLocationUpdate()
is getting called.
from background_locator.
yes the buttons worked as expected
it is the dispose function that is not called, but according to my researches on google, this is a more general issue with flutter.
I'll continue searching and post a solution if i find one
from background_locator.
Hello
I did some researches and here is what I understood:
- you create your flutter app, initialize the plugin and register it
- when the service has a new position that matches timing and distance, it is sent to the callback.
However, if the flutter app is not running (for example if the user quit the app, not just background), the plugin recreate a newbackgroundFlutterView
to execute the associated code.
Then, if the user launch the app, a new instance of flutter is launched
Therefore, you have 2 flutter apps running.
What I would like instead, is that if there is no backgroundFlutterView
, the background service should stop
Could you help me with that, because I don't know kotlin coding at all and I don't manage to understand how your code works
from background_locator.
from background_locator.
For me, the behaviour is still not right.
Here is what I get with your example :
- I start the app and start the background location
-> The log is working and displayed normally - I exit the app (swipe up in the tray) without stopping the background location
-> I still have the notification indicating that location is running in background - I start the app
-> the log is not displayed and does not update. The sticky notification is still active - I start the background location
-> Nothing happen even if the notification is still active - I stop and restart the background location
-> Nothing happen
To get the app running normally again, I have to stop background location and then exit the app before l restart it
For me the correct behaviour should be either :
- at step 2, the background location should stop in order to restart correctly at step 3
- or at step 4, the app should receive normally the callback
from background_locator.
This is the expected behavior, The plugin won't stop locating automatically, you have to manually stop it.
As you stated in step 3, the example won't show log after coming back to ui, This is a bug in ui and I will fix it asap, but the plugin is working correctly in background. at this stage if you press stop the notification disappear too.
from background_locator.
Ok thanks for your answer
from background_locator.
It would be great if a "onTerminated" property added to the plugin. If true then unRegisterLocationUpdate() will be called when app is closed. Calling BackgroundLocator.unRegisterLocationUpdate(); in dispose() doesn't work.
And there should be some click actions on the sticky notification. Sth like stop tracking or resume the app.
This plugin is awesome!!
Looking forward the coming updates.
from background_locator.
@bobppsureway Please open a new issue for this.
from background_locator.
@Sly2024 @bobppsureway auto stop option added.
from background_locator.
Related Issues (20)
- How can I send data from location callback to controller? HOT 1
- location_callback_handler.dart not found when run release project HOT 5
- [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:untitled/location_callback_handler.dart' not found. HOT 4
- Unable to build flutter release version with background_locator lastest HOT 1
- Library Update
- Issue on release build HOT 8
- Unable to capture location in release mode (Android) HOT 4
- Unable to run on iOS
- Error java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient HOT 1
- Error on init app flutter with carp_background_location HOT 5
- java.lang.IncompatibleClassChangeError: The method 'com.google.android.gms.tasks.Task com.google.android.gms.location.FusedLocationProviderClient.requestLocationUpdates(com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationCallback, android.os.Looper)' was expected to be of type virtual but instead was found to be of type interface (declaration of 'rekab.app.background_locator.provider.GoogleLocationProviderClient' appears in /data/app/com.doa.lojisoft.saray-JqLCd0a12SEpAYQu6cUZjg==/base.apk:classes2.dex) HOT 2
- Service stopped suddenly in release mode android
- Data type mismatch (nullable type) and method implementation error in kotlin code just after adding the dependency HOT 1
- [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument: is a regular instance: Instance of 'LocationDto'
- What is speed measured in?
- How to stop service after a period of time?
- Upgrade Background_Locator
- Need Code or Library in kotlin only
- I so confused about "getting location updates even when the app is killed" !!!!
- Is it still maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from background_locator.