paleksandrs / apscheduledlocationmanager Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Not getting location if app terminates or Forcefully killed.
hi
my app have on/off button i want when app is on get location Imedeitly to send to server "app is running" . how to get Imedeitly location?
thank
I'm trying to stopUpdating location from a different view where I start updateLocation but the 'Updatelocation' is still running. Is it possible to turn it off ? and how because I tried
if self.manager.isRunning { self.manager.stopUpdatingLocation() } self.present(alertController, animated: true, completion: nil) }
Hello,
I tried to use this solution in a demo application. It works fine when I put the app in background, but as soon as I lock the device, I notice that the timers are not fired anymore at regular and defined interval. If I specify a time of 60 seconds, and I lock the device, the app is checking for a new location with a random duration between 5 and 15 minutes.
If I play a fake sound in background, the app behaves as expected and the timers correctly fire and restart the location manager. But I don't want to use this hacky solution...
Any idea why the timer is not running when device is locked?
Thanks,
Axel
In your Demo Project, I changed just 1 line of code:
manager.startUpdatingLocation(interval: 2, acceptableLocationAccuracy: 100)
I ran the Demo App and clicked the stop
button when the App collected more than 5 location record, then I found that the App didn't stop, it still push new location records to the text view.
But when I click the stop
button right after a new record pushed onto the screen, sometimes it can be stopped successfully.
I added some debug print code to the functions like startWaitTimer()
, stopWaitTimer()
, startCheckLocationTimer()
and stopCheckLocationTimer()
, then found that if I click just before the wait timer starts, it can be stopped successfully, but once the wait timer starts, the stoptUpdatingLocation()
function can't truly stop the timer loop.
This code will work in suspended state as well?
I am use the didUpdateLocations func to send the data to my firebase server. Before I sent data to the server I just printed the users location to the console in 5 second intervals. Everything was working fine however once I stopped printing the current location and instead sent it to firebase the didUpdateLocations func seemed to be called a 1000 times per second rather than every 5 seconds why is this?
Hi iam trying Installation using CocoaPods but its not working.
Error : [!] Unable to find a specification for 'APScheduledLocationManager'
Can you please help me to fix this.
I want to get location after every 60 Seconds periodically, Everything working fine but, I have got location after 66 Seconds instead of 60 Seconds. Location accuracy is 100. I was also tried by using lower accuracy but no luck.
First Location Time: 12:52:57
Second Location Time: 12:54:03
Third Location Time: 12:55:09
Fourth Location Time: 12:56:15
Fifth Location Time: 12:57:21........so on
I used this for getting the location in background but when app goes to background it only updates location for 8-10min after that if won't event update or give any location changes something is not keeping app alive I guess it is suspended I also tried with example app
manager.startUpdatingLocation(interval: 10, acceptableLocationAccuracy: 100)
when
self.manager.startUpdatingLocation(interval: 20, acceptableLocationAccuracy: 100)
and the app enters background mode, the APScheduledLocationManager won't run
but when
self.manager.startUpdatingLocation(interval: 2, acceptableLocationAccuracy: 100)
the APScheduledLocationManager works nicely
Why?
Iโd presume the method name should be stopUpdatingLocation and not stoptUpdatingLocation?
Of course XCode is able to suggest the right method.
Can I use it along with other LocationManager
.
I add an APScheduledLocationManager in my project, it works ok, but I have realized that its stops after some time. The last location is registered about three hours after the timer was fired.
In that three hours I moved with the device. I stopped to move and later, 8 hours later, the background execution was not working. I don't know if it stops after three, five or even more hours
Any idea about that?
I am using an iPhone with iOS 12.1.4, and the code is the next:
var manager = APScheduledLocationManager(delegate: self)
manager.startUpdatingLocation(interval: 150, acceptableLocationAccuracy: 50)
func scheduledLocationManager(_ manager: APScheduledLocationManager, didUpdateLocations locations: [CLLocation]) { //send location }
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.