How to open the ios Native dialer app from my App

3.3k views Asked by At

I want to open the native dialer app and allow the user to enter the phone number there. The reason why i want this is because in my app the user needs to use USSD codes in order to make calls, but using the code bellow nothing happens (nothing is started)

NSString *phoneNumber = [@"tel://" stringByAppendingString:number]; 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

I read here (StackOverflow) that making calls from your app that contain * and # are forbidden. So i want to ask is there any work around this limitation.

2

There are 2 answers

1
Unheilig On BEST ANSWER

No, there is no workaround with those symbols.

2
Davide Quaglio On

Well i was looking for the same some time ago, i found out that the emulators has problem doing this kind of thing, you should try on a real devices.

Edit from Apple documentation:

To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone app supports most, but not all, of the special characters in the tel scheme. Specifically, if a URL contains the * or # characters, the Phone app does not attempt to dial the corresponding phone number. If your app receives URL strings from the user or an unknown source, you should also make sure that any special characters that might not be appropriate in a URL are escaped properly.

Also written in this post