首页 > 解决方案 > 关于启动拨号颤动的权限

问题描述

我是否需要征得用户的许可才能在 url_launcher 的帮助下启动拨号盘(电话)。

这是基本代码

launchURL(String number) async {
if (await canLaunch(number)) {
  await launch(number);
} else {
  throw 'Could not launch $number';
 }
}

只需简单地用一个数字启动

标签: flutterurlpermissionsmanifestlauncher

解决方案


请参阅此链接以获取答案。有用。基本上,您需要在清单中添加相关权限,您就完成了。

<manifest>

<!-- Nest within the manifest element, not the application element-->
<queries>
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
    </intent>
    <intent>
        <action android:name="android.intent.action.DIAL" />
        <data android:scheme="tel" />
    </intent>
    <intent>
        <action android:name="android.intent.action.SEND" />
        <data android:mimeType="*/*" />
    </intent>
</queries>

<application>
    ....
</application>

https://stackoverflow.com/a/65082750/6032764


推荐阅读