Closed MuhammadEhsanMirzaei closed 3 months ago
when the app is terminated and use it when opening the app or
The persists each geofence event in its SQLite database.
If you’ve configured a Config.url, the plugin will automatically post each event to your server, regardless if terminated.
see api docs “HTTP Guide”
Also see api docs Config.enableHeadless
I found this in the document:
[PERSIST_MODE_ALL] | (DEFAULT) Persist both geofence and location events
But that didn't work. Do I set this persistMode: 2
?
That didn't work too
Show me the Config you supplied to .ready(), which was requested in the issue template that you ignored
bg.BackgroundGeolocation.ready(
bg.Config(
pausesLocationUpdatesAutomatically: false,
disableLocationAuthorizationAlert: true,
reset: true,
stopOnStationary: false,
stopTimeout: 0,
stopAfterElapsedMinutes: 0,
desiredAccuracy: bg.Config.DESIRED_ACCURACY_NAVIGATION,
distanceFilter: 100,
stopOnTerminate: false,
startOnBoot: true,
debug: true,
persistMode: 2,
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
),
).then((bg.State state) {
if (!state.enabled) {
bg.BackgroundGeolocation.start();
}
});
Since you’ve not provided an url
in your Config, each event is still available to you in the plug-in’s SQLite db. See api docs BackgroundGeolocation.locations
.
Also, why did you do this?
stopAfterElapsedMinutes: 0,
That means “.stop()
after elapsed minutes".
if you don’t know exactly what that does, don’t configure it.
I set stopAfterElapsedMinutes: 0
because I manually stop the background.
For checking the database, I used this code
String log = await bg.Logger.getLog(bg.SQLQuery( start: DateTime.parse('2022-08-22 16:25'), end: DateTime.now()));
But geofence in terminated mode didn't record.
because I manually stop the background.
delete that Config option.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Does this package save geofence onEnter in the database when the app is terminated? Is there any way to save on entry when the app is terminated and use it when opening the app or use it in the background to send an event to the server?