I used this code to make phone call:
NSString *phoneNumber = [@"tel://" stringByAppendingString:mymobileNO.titleLabel.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
and when the call ends, it does not take user back to the app. However, if I show a website in UIWebView and there is a phone number in the website(ie UIWebView recognises it), and if I tap that phone number link to make phone call, I will be taken back to the app when the call finishes.
My preliminary thinking is that the UIWebView does something internally like a deep link to the Phone app then another deep link inside the deep link to take the user back to the app. But I’m not sure. Is there a way to implement this feature?
Thanks!
You need to use the
telpromptURL, nottel.So:
This will also give the user a confirmation box before calling the number.
Edit:
This question covers the same issue.
Edit 2:
For those wondering if this URL will result in rejection from the App Store, the answer is generally no. The greater risk is that Apple will suddenly stop supporting the
telpromptscheme. As explained by this article, there is a slightly ‘safer’ way of implementingtelpromptwithUIWebView(which usestelpromptinternally, even if you call it withtel). The relevant code from the article shows how using the documentedtelscheme can still give you the effect oftelprompt:(Code taken from the article reference in my second edit)