拨号程序未显示完整的美元代码,例如:* 123 * 1# [英] The dialer is not showing full ussd code eg: *123*1#

查看:82
本文介绍了拨号程序未显示完整的美元代码,例如:* 123 * 1#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 url_launcher 插件进行通话,但拨号程序未显示字符:

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';
}


推荐答案

您需要使用 URL编码用于URL中的特殊字符。

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

所以等于%23

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

其他方法是可行的编码用户键入的数字,并将其通过 Uri.encodeFull(urlString )或 Uri.encodeComponent(urlString)

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

赞。

launch("tel:" + Uri.encodeComponent('*123#'));

这篇关于拨号程序未显示完整的美元代码,例如:* 123 * 1#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆