簡體   English   中英

Flutter url_launcher 調用時忽略數字符號(#)

[英]Flutter url_launcher ignores number sign(#) when call

我在我的應用程序中使用 url_launcher。 當我撥打包含數字符號(如“*123#”)的號碼時,它會忽略數字符號並只撥打 *123

你也應該使用 Uri.encodeComponent 來編碼#

onPressed: () {
        String no = Uri.encodeComponent('*123#');
        launch('tel:$no');
      },

你必須使用Uri.encodeComponent#你的字符串

onPressed: () {
        String mycode = Uri.encodeComponent('*#06#');
        launch('tel:$mycode');
      },

因為需要對特殊字符進行編碼才能被您的設備使用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM