0

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)

Autonomous
  • 8,935
  • 1
  • 38
  • 77

1 Answers1

0

As you commented, Google Maps does speak the announcement using VoiceOver. What you've observed appears to be a VoiceOver behavior. If you need to perform an announcement, anyway, consider using the AVSpeechUtterance API.

Justin
  • 20,509
  • 6
  • 47
  • 58
  • Oh, I thought Google map doesn't use Apple's Voice-over. I am using voice-over in the rest of my app. So if I have to use `AVSpeechUtterance`, then should it be only in the background mode? – Autonomous Apr 23 '15 at 00:36
  • Correct. Right on both counts. – Justin Apr 23 '15 at 20:48