I need to make call to a number, that start with #. For example phone number in Russia looks like +79123817711 and I need to call #79123817711. I\'m trying this:
<
I have achieved this by encoding the ussd and pass it in the url and it works just fine
Here is an example:
extension String {
/// Calling ussd number
func callUSSD() {
guard let urlString = self.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) else { return }
guard let url = URL(string: "tel://\(urlString)") else { return }
UIApplication.shared.open(url, options: [:])
}
}
Usage:
@IBAction func callTapped(_ sender: UIButton) {
"*1124#".callUSSD()
}