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

The application stops running in the background #2184

Open
omerabdelhady62 opened this issue Oct 23, 2024 · 1 comment
Open

The application stops running in the background #2184

omerabdelhady62 opened this issue Oct 23, 2024 · 1 comment

Comments

@omerabdelhady62
Copy link

When the application is in the foreground, it works normally I want the application to run all the time when the application is in the background I want the code to run all the time in the background What happens is that the application stops in the background after a certain time

  • Platform: iOS
  • OS version: 17.5.1
      // Geolocation Config
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 0,
      isMoving: true,
      stopTimeout: 5,
      stationaryRadius: 0,
      stopOnStationary: false,
      disableLocationAuthorizationAlert: false,
      preventSuspend: true,
      heartbeatInterval: 5,
      locationTimeout: 10,
      allowIdenticalLocations: true,
      pausesLocationUpdatesAutomatically: false,
      foregroundService: true,
      activityType: BackgroundGeolocation.ACTIVITY_TYPE_OTHER,
      debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      showsBackgroundLocationIndicator: true,
      disableStopDetection: true,
      stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
      startOnBoot: true, // <-- Auto start tracking when device is powered-up.
      // HTTP / SQLite config
      url: "http://yourserver.com/locations",
      batchSync: true, // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
      autoSync: true, // <-- [Default: true] Set true to sync each location to server as it arrives.
      headers: {
        // <-- Optional HTTP headers
        "X-FOO": "bar",
      },
      params: {
        // <-- Optional HTTP params
        auth_token: "maybe_your_server_authenticates_via_token_YES?",
      },
    }).then((state) => {
      BackgroundGeolocation.start();
      console.log("- BackgroundGeolocation is configured and ready: ", state);
    });

Expected Behavior

The application connects in the background all the time and a blue bar appears at the top, as happens with Google Maps

Actual Behavior

The connection to the location is lost after some time in the background

@christocracy
Copy link
Member

See Wiki Debugging. Learn to fetch logs using method ".emailLog" (search the API docs for usage).

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