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

how to still run app in background after restart mobile #2185

Open
omerabdelhady62 opened this issue Oct 23, 2024 · 0 comments
Open

how to still run app in background after restart mobile #2185

omerabdelhady62 opened this issue Oct 23, 2024 · 0 comments

Comments

@omerabdelhady62
Copy link

When the application is in the background, the application works fine, but when I restart the phone, the application is in the background, but it does not work until I open it.

Your Environment

  • Plugin version:
  • Platform: iOS or Android
  • OS version:
  • Device manufacturer / model:
  • React Native version (react-native -v):
  • Plugin config
BackgroundGeolocation.ready({
      // 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);
    });
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

1 participant