0

I have the task.

  • My iOS app must send heartbeat messages to the server once for every 10 minutes.
  • iOS app must do this always when the app is not killed (i.e. terminated i.e. removed from task manager) despite the screen is locked, the app in the background.

I'm trying to do this using "background location". But if I use CLLocationUpdate in its' usual mode - I get my battery drained.

Could you help me?

nickolay
  • 3,643
  • 3
  • 32
  • 40

1 Answers1

0

You are out of luck, this is not possible on iOS. Yes you can use the location manager, but if I set a my desk for an hour your app will not get a location update.

Also it is misusing the background location mode and might get your app rejected.

An option can be to use silent push notification, you server will send a silent push to the device where the device will respond to it in the background. Read more about application:didReceiveRemoteNotification:fetchCompletionHandler: and the Local and Remote Notification Programming Guide.

rckoenes
  • 69,092
  • 8
  • 134
  • 166