How to make USSD call on iOS 15.4 beta

My App try to call via tel: scheme for USSD, it worked on iOS 15.3 and earlier but doesn't work on iOS 15.4 beta.

let number = "10*10#" // Doesn't work.
// let number = "1234" // This is Okay.

guard let url = URL(string: "tel:" + number),
          UIApplication.shared.canOpenURL(url) else {
    fatalError()
}

UIApplication.shared.open(url, options: [:]) { success in
    print("success: \(success)") // This is true
}

canOpenUrl() returns true, which means now we can call open() method. But nothing happens when we call open(url: options: completion:).

Answered by user21 in 712497022

This issue seems to be resolved with iOS 15.5 beta 4. So, I think we should wait for its release and my user for updating iOS.

You need to percent-encode your string for characters like # to work in a URL.

You can add this extension to String:

import Foundation

extension String {
    func  percentEncoded() -> String? {
        return (self as NSString).addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)
    }
}

Then, you would use it like so:

if let percentEncodedString = "10*10#".percentEncoded(), let url = URL(string: "tel:" + percentEncodedString) {
    // Use url
}

I have the same problem

we can dial using openURL and using tel://number. the moment we have something like "tel://number;conference%23" it fails, but only on iOS 15.4 beta, this same conference number dialing works without issue on iOS 15.3.1 and previous versions. There must be tickets with their engineers about this issue and out ticket has yet to be replied so likely they will be addressing in the actual release version of 15.4.

Same issue here, waiting for a hotfix :(

Same issue, I noticed that it's still working if linked in a WebView but it's not working with UIApplication.shared.open()

Only 15.4 seems affected.

We are having the same issue. Worked from iOS11 until iOS15.3.

Same issue here. 15.4 doesn't allow use to use the # character in any dialer therefore our app cannot prompt the dialer. It looks like it just drops the character. Apple please let us know if this is the intended behavior going forward or they will be a hot fix.

I am facing the same issue if you got the solution please comment Thank You

From the documentation https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html#//apple_ref/doc/uid/TP40007899-CH6-SW1 "Specifically, if a URL contains the * or # characters, the Phone app does not attempt to dial the corresponding phone number." It looks like the previous behavior (allowing special characters) may have been the bug and now the normal behavior. Hopefully not.

We are using this functionality to make an anonymous calls (ReactNative), and starting from 15.4 it became broken (or working properly according to the documentation).

Weirdly enough, clicking a link on the website<a href="tel:#31#1111111111" target="_blank">tel</a> still works...

It would be super helpful if Apple explains if it's a bug or a feature.

same issue here. it appears only on iOS 15.4 our url of tel scheme looks like this:

tel://+1234567890,,33097278*110213*1#

adding percent encoding does not fix the issue, because it adds encoding to “#”, but it does not add it to “*”

need working solution asap

same issue happens only on iOS15.4, need an alternate solution or a fix from apple

Same issue here, and this needs to be addressed ASAP as this interferes with the ability for our clients to quickly dial into a Zoom call.

With Zoom as such an essential piece of everyday work now, custom call-in URLs have never been more important.

Being able to include the # character allows for users to dial directly into the meeting with 1 touch.

Hoping Apple understands the time sensitive nature of this issue for developers.

Same issue for us, still waiting for a hotfix :(

Sad to report that the iOS 15.4.1 update didn't address this 😞

Devs: if you haven't done so already, file a ticket with Apple using the Feedback Assistant app.

How to make USSD call on iOS 15.4 beta
 
 
Q