【问题标题】:Phone call in flutter扑通扑通的电话
【发布时间】:2020-03-16 09:50:33
【问题描述】:

我的电话呼叫方法不起作用。当我直接给我的手机号码时,它就可以工作了。但是,当我从我的数据库中通过时,它无法正常工作......它总是拨打 662453......
这是我的代码:

void _launchCaller(String mobile) async {
    //debugPrint(mobile);
    //UrlLauncher.launch('tel:${contact.phone}');
    const url = "tel:mobile";
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

【问题讨论】:

标签: flutter


【解决方案1】:

这是语法错误吗? "tel:mobile" 不起作用,"tel:$mobile" 会。

662453 也是“移动”一词在手机键盘上的显示方式。 (查看每个数字下的字母)

【讨论】:

  • 谢谢..我是通过使用 URLlauncher.launch('tel:$mobile);
猜你喜欢
  • 2022-01-23
  • 2019-01-09
  • 2022-11-21
  • 2013-03-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-26
相关资源
最近更新 更多