How does the Reminders app know how to track my location on the day of the reminder only?

In the reminder app introduced with iOS 5, you can adjust the geofence, so a reminder appears when you approach an address. Based on location, you can also customize a specific day. Apple is very effective in how they handle location and time reminders, as they don’t start tracking your location until it becomes a reminder day.

Example:

Monday, and I set a reminder on Wednesday to remind me when I get home to take out the trash.

If you pay attention, you will notice that the location service indicator (purple triangle) next to the battery life indicator will not be displayed until midnight on Wednesday.

I'm curious if there is a public API that allows your application to respond to time changes like this, or if they use some private APIs.

I could find UIApplicationSignificantTimeChangeNotificationand applicationSignificantTimeChange:, but the documentation states that

If your application is currently paused, this message is queued until your application returns to the foreground, after which it will be delivered.

So this makes me think that this will not work.

My other thought is to use UILocalNotification and set a notification for the time you are interested in, and when this notification starts, run the code to enable location services. Due to my lack of experience with UILocationNotification , however, I know if such code can be executed.

- , ?

+5
1

( ) , , .

"didReceiveLocalNotification" appDelegate, geofence .

0

All Articles