Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The dialer is not showing full ussd code eg: *123*1#

Tags:

flutter

dart

ussd

I am using the url_launcher plugin for call, but the dialer is not showing the # character:

String url = 'tel:*123#';
if (await canLaunch(url)) {
    await launch(url);
} else {
    throw 'Could not launch $url';
}
like image 900
Deepak Gehlot Avatar asked Dec 06 '25 23:12

Deepak Gehlot


1 Answers

You need to use URL encoding for special character in a URL.

So # equals %23

This will work launch('tel:\*123\%23');

Other Way is to encode the number typed by user and pass it through Uri.encodeFull(urlString) or Uri.encodeComponent(urlString)

Like this.

launch("tel:" + Uri.encodeComponent('*123#'));
like image 62
anmol.majhail Avatar answered Dec 08 '25 14:12

anmol.majhail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!