Skip to content
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

Information: Need to change post template after calling the start() method #1397

Open
prithivirajQS opened this issue Dec 27, 2024 · 1 comment

Comments

@prithivirajQS
Copy link

Your Environment

  • Plugin version: 4.16.2
  • Platform: Android
  • OS version:
  • Device manufacturer / model:
  • Flutter info (flutter doctor):
  • Plugin config:
bg.Config(
            reset: false,
            debug: false,
            logLevel: bg.Config.LOG_LEVEL_OFF,
            desiredAccuracy: bg.Config.DESIRED_ACCURACY_MEDIUM,
            // distanceFilter: 0,
            method: "POST",
            autoSync: true,
            autoSyncThreshold: 1,
            stopOnTerminate: false,
            startOnBoot: true,
            maxRecordsToPersist: 1,
            // locationsOrderDirection: "DESC",
            stopOnStationary: false,
            url: url,
            locationUpdateInterval: timeinms,
            fastestLocationUpdateInterval: timeinms > 1000 ? timeinms - 1000 : timeinms,
            // locationUpdateInterval: 5000,
            locationTemplate: paramsToServer,
            // stopTimeout: 240000,
            // activityRecognitionInterval: timeinms,
            minimumActivityRecognitionConfidence: 25,
            // disableStopDetection: true,
            foregroundService: true,
            notification: bg.Notification(
              priority: bg.Config.NOTIFICATION_PRIORITY_HIGH,
              sticky: true,
              text: "Location Service Activated -#asdf#).toString()}",
              title: "#asdf#",
            ),
            backgroundPermissionRationale: bg.PermissionRationale(
              title: "AppConfigs.BG_PERMISSION_TITLE",
              message: "AppConfigs.BG_PERMISSION_MESSAGE",
              positiveAction: "OK",
              negativeAction: "Cancel",
            ),
          ),

Expected Behavior

If there is a method to change the post template after the start(), it would be helpful.

Actual Behavior

i need to change the post template dynamically after starting the tracking. currently i am stopping the tracking and then calling start(). There is a diffculty we are facing, "Waiting for the prev action to complete."

Steps to Reproduce

Context

Based on the app functionality, i need to change a flag in the post template.

Debug logs

Logs
-
@christocracy
Copy link
Member

Yes, see api docs .setConfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants