question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StartOnBoot is not working properly

See original GitHub issue

It seems when StartOnBoot is switched on, it should have switched on AutoStart setting in the mobile but that didn’t happen.

Your Environment

  • Plugin version: 3.0.0-beta.41
  • Platform: Android
  • OS version: 7.1.2
  • Device manufacturer and model: Redmi 4, Xiaomi
  • Cordova version (cordova -v): 7.1.0
  • Cordova platform version (cordova platform ls):
  • Plugin configuration options:
BackgroundGeolocation.configure({
            //locationProvider: backgroundGeolocation.provider.ANDROID_DISTANCE_FILTER_PROVIDER,  //Distance Provider
            locationProvider: 1,         //Activity Provider
            debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
            stopOnTerminate: false, // <-- enable this to clear background location settings when the app terminates
            startOnBoot: true,  //Android Only, starts location tracking on device boot
            interval: this.callbackInterval,                   //2min //In ms, Minimum time interval before update //Only for Android
            startForeground: true,       //Keep background location tracking active in foreground

            url: this.globals.webApiBaseUrl + "/" + this.globals.apiVersion+ "/Location/AddMauron85Locations?UserId="+ model.UserId,
            syncUrl: this.globals.webApiBaseUrl + "/" + this.globals.apiVersion + "/Location/AddMauron85Locations?UserId="+ model.UserId,
            syncThreshold: 10,     //Http post occurs after failed post locations number is beyond syncThreshold
            maxLocations: 100000,   //Max locations to store in local db

            desiredAccuracy: 10,    //In Meters
            stationaryRadius: 60,  //30,  //In Meters
            distanceFilter: 40, // 20,     //In Meters, minimum distance a user must move horizontally before update

            notificationsEnabled: true,
            activityType: 'AutomotiveNavigation',   //IOS Only
            notificationIconSmall: 'notification',
            notificationIconLarge: 'icon',
            notificationIconColor: '#f86900',
            notificationTitle: 'SmartTask', // <-- android only, customize the title of the notification
            notificationText: 'Click to open App',

            //ANDROID_ACTIVITY_PROVIDER 
            fastestInterval: (this.callbackInterval/3),     //fatest interval in ms.
            activitiesInterval: this.callbackInterval,      //2 min //Activity recognition interval in ms
            stopOnStillActivity: false,       //Incase of still activity donot record location
            postTemplate: model
        });

Context

Debug logs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mauron85commented, Oct 28, 2018

Fixed in alpha.46

0reactions
adamalexandercommented, Aug 24, 2019

Hey I have the latest version of the plugin… and the background geolocation stops when the device is rebooted. @mauron85 can you suggest anything I can try to solve this issue using this plugin?

Read more comments on GitHub >

github_iconTop Results From Across the Web

stopOnTerminate, startOnBoot not working . #89 - GitHub
Yes, you do both. You only #configure in your main component. If want to do the same stuff in the callback to #configure...
Read more >
Boinc start on boot not working correctly.
I recently updated to BOINC Mgr 7.4.36. Now it seems there is a problem with startup and shutdown of the two Projects I...
Read more >
Trying to start a service on boot on Android - Stack Overflow
I've been trying to start a service when a device boots up on android, but I cannot get it to work. I've looked...
Read more >
Start on boot not working : r/blokada - Reddit
I'm having this issue as well. Every time I restart my phone, I have to manually open blokada, which then starts up on...
Read more >
startmenuexperiencehost does not start on boot up Windows ...
When my PC goes to sleep or I restart it and log back in, I do not see the icons on the task...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found