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

delay10Seconds timer not set/reset when entering background #5

Open
ddanielczyk opened this issue Nov 5, 2014 · 2 comments
Open

delay10Seconds timer not set/reset when entering background #5

ddanielczyk opened this issue Nov 5, 2014 · 2 comments

Comments

@ddanielczyk
Copy link

Hi

I am trying to user your code in my app, and found our few problems:

  1. I changed the main timer from 1 minute to 5 mintes, delay timer stays at 10s. When you start app, it update locations and finish after 10 seconds. Then put app to background, you it will start updating location again - and will update them in background for more than 4 minutes, when main timer reset again. I think you should not call [locationManager startUpdatingLocation] in -applicationEnterBackground. Is this a bug or you wanted it this way for some reason? Maybe it was just not that obvious with 1 minute timer, but with longer timer it is a problem. If I set timer for 1 hour, it would constantly update location for one hour after going to background.
  2. Wouldn't it be better if instead of creating separate timer for updateToServer, just put call to [self updateToServer] in -stopLocationDelayBy10Seconds ? At this point you always has the most current user location.
@codecat
Copy link

codecat commented Dec 3, 2014

Since the max execution time is maximum 3 minutes, the 5 minute change probably goes over it, making it never start the other tasks. Does putting the main timer to back to 1 minute fix this? Curious myself, I haven't tried it myself yet.

@wwwang89
Copy link

Hi ,voyage11, thanks for sharing ! I want to upload my locations every 200 meters to server. no matter the app is active or in background or is killed ,I can do that . but when I run your project ,and kill the app ,it could not upload the location to server ,how can I do that?thanks !

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

3 participants