0

I'm dialing a phone number inside a Xamarin Forms app in iOS code called using the DependencyService, like this:

var url = new NSUrl ("tel:" + phoneNumber);
if (!UIApplication.SharedApplication.OpenUrl (url)) {
    var av = new UIAlertView ("Not supported",
      "Scheme 'tel:' is not supported on this device",
      null,
      "OK",
      null);
    av.Show ();
};

Note I'm using tel and not telprompt.

I tested on an iPhone 6 and iPhone 4, and it works as expected. However, on an iPhone 6S, it pops up a confirmation dialog that looks like this (screenshot taken from the Internet, not my app):

enter image description here

According to answers to this question, dialing a number from an app shouldn't show any dialog, it's only shown when dialing a number from within Safari, as per the Apple documentation:

The tel URL scheme is used to launch the Phone app on iOS devices and initiate dialing of the specified phone number. When a user taps a telephone link in a webpage, iOS displays an alert asking if the user really wants to dial the phone number and initiates dialing if the user accepts. When a user opens a URL with the tel scheme in a native app, iOS does not display an alert and initiates dialing without further prompting the user. However, a native app can be configured to display its own alert.

However it's happening in my app on this phone. As far as I can tell there is no configuration change or third party software that is making this happen. It is a problem because I'm already popping up my own confirmation dialog, so the user gets asked to confirm twice. If I remove my dialog then there won't be any confirmation dialog on the other phones, which isn't acceptable either. Another annoyance is that it shows the "not supported on this device" message if the user taps cancel, which is wrong, so I will have to change it to something more vague and generic. One workaround might be to use telprompt instead to always show the dialog, and remove my own, but I'd prefer not to do this because I have some other stuff I need to show on the dialog so I want to have a custom one.

How do I stop this call confirmation dialog from appearing, or if that's not possible, how do I detect if it is going to appear so I can not pop up my own?

Community
  • 1
  • 1
samgak
  • 23,944
  • 4
  • 60
  • 82
  • Happening only in one phone, umm.. What's the OS version of each of those iPhones? – pinedax Apr 08 '17 at 00:02
  • @apineda I only have access to 3 phones so far for testing. I don't have the OS version for the 6S to hand right now, is this behaviour something that differs by OS level? – samgak Apr 08 '17 at 06:33

0 Answers0