I am working on a simple app where I need to make post a UIAccessibilityAnnouncementNotification
when user is near a specific point. When the app is active, everything works fine. When I press the Home
key, everything stops working.
To narrow down the problem, I started printing in didUpdateHeading
(since I can't sit at my place, and have didUpdateLocations
called). I saw that even when I locked the screen, heading is getting updated. Further, I placed a breakpoint on the line where UIAccessibilityAnnouncementNotification
was supposed to be fired. The control arrives on that line and goes to the next line without posting the announcement.
My question: How do I make the UIAccessibilityAnnouncementNotification
work in lock screen? Google maps app does the same thing. They don't use voice-over but the announcement (such as "Turn left") is heard in lock screen. Do I have to use a speech synthesizer to achieve the same? Sample code illustration would be great, as I am a beginner in iOS development.
App settings: iOS 8.2, iPhone 4S, XCode 6.2, Objective-C, App registers for location updates in background mode (in .plist
file)