3

I want to suggest user to make a call from app with one pop up with specific text. I show him first pop-up and if he agrees, then I run a code to make a call from the app. But independently of using tel://, telprompt://, tel: for link, I always get second pop-up from system with phone number in it. How should I change my code to not get this second pop-up from system? Searched questions like this here, none one them was helpful.

After these lines of my code second pop-up appears:

 NSString *phoneURLString = @"tel://11111111";
 NSURL *phoneURL = [NSURL urlWithString:phoneURLString];
 if ([[UIApplication sharedApplication] canOpenURL:phoneURL]) {
    [[UIApplication sharedApplication] openURL:phoneURL];
 }

I have also added to Info.plist to section LSApplicationQueriesSchemes values tel and telprompt. Will appreciate any help, thanks in advance!

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