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.

How to change interval on iOS?

See original GitHub issue
       const INTERVAL = 600 * 1000; // 10 minutes

        window.BackgroundGeolocation.configure({
          desiredAccuracy: window.BackgroundGeolocation.HIGH_ACCURACY,
          stationaryRadius: 50,
          distanceFilter: 50,
          notificationTitle: 'Background tracking',
          notificationText: 'ENABLED',
          debug: false,
          startForeground: true,
          startOnBoot: true,
          stopOnTerminate: false,
          activityType: 'OtherNavigation',
          pauseLocationUpdates: false,
          saveBatteryOnBackground: false,
          locationProvider: window.BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
          interval: INTERVAL,
          fastestInterval: INTERVAL,
          activitiesInterval: INTERVAL
        });

I know the interval properties are only for Android, but is there any similar system at all for iOS? On Android the location updates every 10 minutes, but on iOS it’s every 1 minute.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mauron85commented, Apr 2, 2018

I’m sorry that this plugin didn’t fulfil your expectations.

There has to be a workaround, otherwise you might as well remove iOS from the package entirely with background location tracking.

One would expect some degree of gratitude, but well let’s keep this upon my consideration. OK?

The problem is that iOS LocationProvider doesn’t have timeouts. Some libraries are doing interval polling by setting timer. However timers don’t fire when app is in background. So I don’t want to spend time implementing something that actually I won’t use. If somebody implement this as separate location provider (as we have RAW, DISTANCE, ACTIVITY). I would merge it.

1reaction
ZachHandleycommented, Apr 2, 2018

@mauron85 I have this issue as well and your comment does absolutely nothing to help. Clearly it must work in some capacity because otherwise how do you implement background location tracking on iOS?

Right now in my app it’s implemented in it gets the location every single minute, and that uses about 35-40% of battery life in a day.

There has to be a workaround, otherwise you might as well remove iOS from the package entirely with background location tracking.

Edited for clarity: Can I sleep the function for 14 minutes, is there anything I can do? This can’t be an iOS restriction, otherwise my phone battery life would die in seconds from all the apps using my location all the time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I edit custom repeat intervals for events on iOS?
to edit repeat intervals, go to that event-> click on edit button, select repeat option-> select ...
Read more >
How to Change Snooze Time on iPhone - Lifewire
Tap Regular, then choose your preferred interval (up to 20 minutes).
Read more >
Customize workouts on Apple Watch
Change workout goals on your Apple Watch ... Add work and recovery intervals: Tap Add, tap Work or Recovery, then choose Time, Distance,...
Read more >
How to create custom Apple Watch interval workouts
Creating custom workouts · Open the Workout app. · Navigate to a specific activity (outdoor running, hiking, etc.) · Scroll all the way...
Read more >
Change Interval Of CADisplayLink - ios - Stack Overflow
For anyone else looking here. It is somewhat possible to achieve this effect. By changing the preferredFramesPerSecond property ...
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