Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What do you actually want to know every hour? Are you trying to determine the location accurately, or just determine if the phone has moved significantly? <code>startMonitoringSignificantLocationChanges</code> will notify you when the phone moves "significantly" (which generally means changing cell towers). In cities this can happen quite often. <code>startMonitoringForRegion:desiredAccuracy:</code> will only notify you when you move outside of a given radius.</p> <p><code>startMonitoringSignificantLocationChanges</code> is pretty cheap. It mostly relies on the cell antenna, which is generally on anyway. If it fires more than once an hour, you could always just skip processing and return. But there's no guarantee that you'll be called once an hour, particularly in rural areas.</p> <p>If you are a VoIP app, then you may register a periodic "checkin" interval when you may run code. But you cannot do this for location apps.</p> <p>Have you profiled your code using the Energy Diagnostics instrument? What's actually eating time and power? Are you chewing on the radio, the CPU, the disk?</p> <p><strong>EDIT</strong></p> <blockquote> <p>When the app dies, Significant Changes still continue to run and leave a small direction arrow icon next to the percentage on the top toolbar of the iPhone. My users complain that the icons remains after killing the app</p> </blockquote> <p>After the app dies, if you were registered for significant changes, you would expect to be relaunched in response to them. If you want to unregister in cases where you are terminated, you can add <code>stopMonitoring...</code> to your <code>applicationWillTerminate:</code> method. This isn't guaranteed to be called, but it is a good thing to do, and I believe it will be called if the user terminates you directly and you were not suspended (haven't tested that).</p> <p>Again, significant location changes should be extremely cheap in terms of battery life as long as there is cell coverage. They should not force the GPS to stay on.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload