问题
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.
回答1:
No, there is no workaround with those symbols.
回答2:
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
来源:https://stackoverflow.com/questions/27224480/how-to-open-the-ios-native-dialer-app-from-my-app