2

I need to create a button to trigger an emergency phone call on my app

The problem is that there's at least 3 main phone number ( 112, 911, 999)

Since you can do it natively on your phone is there a way to do it programmatically?

UIApplication.shared.open(number as URL, options: [:], completionHandler: nil)
RajeshKumar R
  • 15,445
  • 2
  • 38
  • 70
  • 1
    Possible duplicate of [Calling a phone number in swift](https://stackoverflow.com/questions/27259824/calling-a-phone-number-in-swift) – ZGski May 28 '19 at 15:32
  • 1
    @ZGski That's not a duplicate. The OP isn't asking how to call a phone number. The OP is asking how to know which emergency phone number to use. – rmaddy May 28 '19 at 15:33
  • I believe (but don't know 100%) that 112 will work globally; the carrier translates it to the local emergency number – Paulw11 May 28 '19 at 19:04
  • It looks like it isn't 100%, but it will work in a lot of places https://www.triplezero.gov.au/Pages/Usingotheremergencynumbers.aspx#mob112 – Paulw11 May 28 '19 at 19:13
  • @ValentinScheldeman did you ever find an answer to this question? If so can you please post it – Lance Samaria Oct 08 '19 at 05:44
  • Hello @LanceSamaria sorry for the late answer i was sick and not working, I ended up just calling " 112 " as it is a number used pretty much everywhere, but i could found nothing from Apple to trigger the "emergency call" yourself like they can do :/ – Valentin Scheldeman Oct 11 '19 at 14:10
  • @ValentinScheldeman ok cool, thanks for getting back to me – Lance Samaria Oct 11 '19 at 14:21

1 Answers1

1

Check this page where you can find which number to call depending on where you are located. You can use JSON to extract the right data. https://favmaps.es/emergency/numbers/

Luiyi
  • 11
  • 1