IOS: How to initiate a contact book call with special characters (# / *) in the number?

I am currently working on an iOS application that uses real-time streaming, and our users have requested the feature to automatically block incoming calls when streaming. I know that there is no API for this, so we decided that it has a button in the user interface that automatically calls a specific number (provider-specific) that turns on or off the blocking of incoming calls. This is done simply by opening tel: URL.

All this works fine, and although it may not be very user-friendly, as it forces users to exit the application, I really consider it the most elegant solution using the tools provided by the iOS API.

However, there is one caveat, however, some telecommunication service providers do not have a single short number that people can call to enable or disable this feature. Instead, they use long codes that have special characters, such as # and *. Unfortunately, iOS refuses to open tel: URL with these characters, presumably for security reasons. However, I was wondering if users can put these numbers in contacts, and then iOS will directly call these contacts?

I know how to directly access phone numbers from the address book, but this is useless because I will still have a problem with URLs that are not accepted. So, is there a way, say, to have a tel: URL with a contact id or something like that?

Thanks for reading and / or response. :)

+4
source share
1 answer

You cannot dial # or * from the application. This is Apple’s plan to protect us from nasty people.

To quote from Apple documentation:

To prevent users from maliciously redirecting phone calls or changing the behavior of the phone or account, the Phone application supports most, but not all, special characters in the phone circuit. In particular, if the URL contains * or # characters, the phone application does not try to dial the corresponding phone number.

... and converting to ASCII characters and other tricks don't work either (I tried).

+2
source

Source: https://habr.com/ru/post/1343943/


All Articles