1

I have set in the Info.plist, the "app require background modes", the "app registers for location updates".

I put the app to be in the background, and I do get the location delegates for a while, but after 25 minutes it stopped getting the locations.

How do I know that? Each call of the delegate, it sends the data to the server (parse) .

I am also wondering if the problem arises because the location is turned off in the background, or because I can't send data to the server at background.

Also do I have to turn on audio to keep it alive?

According to Apple, I can listen in the background with:

  • apps that play audible content to the user while in the background, such as a music player app
  • apps that record audio content while in the background
  • apps that keep users informed of their location at all times, such as a navigation app
  • apps that support Voice over Internet Protocol (VoIP)
  • apps that need to download and process new content regularly
  • apps that receive regular updates from external accessories

Do I have to turn on an audio? Our app needs to get data location constantly from business.

This issue is amazing. There are dozens of opinions about what you can do and what you can't do. There is no one place that tells you how you can sample background locations, and if Apple allows this.

karel
  • 5,489
  • 46
  • 45
  • 50
Curnelious
  • 1
  • 16
  • 76
  • 150

1 Answers1

0

I guess problem is with pausesLocationUpdatesAutomaticallyBy

By default LocationManager pausesLocationUpdatesAutomatically is Yes, so after some if your device is not move or not change location may OS will stop the app, so set NO for this property , and not need to turn on an audio.

Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121
  • thanks. but actually the device did moved . and now i have tested it for 40 minutes without moving and it worked. seems that sometimes it works and sometimes its don't .. where can i find the new roles for the ios7 with location ? – Curnelious Feb 03 '14 at 11:10
  • http://stackoverflow.com/a/19099826/1597744 , https://developer.apple.com/library/Mac/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html – Toseef Khilji Feb 03 '14 at 11:13
  • thanks. thats not my case. its amazing how many speculations there are about this issue . No one knows what you really allowed to do and whats not. i am just lost . – Curnelious Feb 03 '14 at 11:24
  • 1
    @Curnelious: you are right i am also lost in this issue.. May Apple Help us Soon~ :) – Toseef Khilji Feb 03 '14 at 11:25