3

My current enterprise iOS app includes an emergency 911 call feature for our guys in the field who often work under potentially unsafe conditions. The idea was that in case of a medical emergency, they could tap the "Dial 911" button and the phone would just dial.

In order to prevent a mistaken call, the user has a 10 second grace period to cancel the call, at the end of which the system will place the call. But in the unusual and extreme case where the user may be seriously incapacitated and unable to respond further, the call should go on through after the ten second gap.

I had all that working before the latest iOS update. Once the user tapped the "Call 911" button, the phone would complete the call without having to confirm. But now since the latest update, the phone has started showing a confirmation alert anyway.

Here's the line of code that I had been using which, until now worked fine:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",strEmergencyNumber]]];

The trick apparently being to use the tel: command.

I'm wondering if there is any other way to make the phone skip the confirmation alert. Otherwise, this may be a worthless function, with potentially fatal results.

Not trying to sound dramatic, but that's just the way it is. Ours is a sometimes-very dangerous business.

Thanks!

Bill Norman
  • 883
  • 11
  • 29

1 Answers1

5

Unfortunately, what you desire to do is not possible, at least in the existing versions of iOS. That dialog will always show.

Per Apple's documentation for openURL:

When a third party application invokes openURL: on a tel://, facetime://, or facetime-audio:// URL, iOS displays a prompt and requires user confirmation before dialing.

Andy Obusek
  • 12,614
  • 4
  • 41
  • 62
  • As much as it disappoints me, I guess I will have to accept your answer. I don't hold out much hope that Apple will change it back. Thanks. – Bill Norman Apr 26 '17 at 13:54
  • @BillNorman is there a way to detect whether user accepted the prompt or canceled? – moeseth Oct 07 '17 at 10:49