flutter - 关于启动拨号颤动的权限
问题描述
我是否需要征得用户的许可才能在 url_launcher 的帮助下启动拨号盘(电话)。
这是基本代码
launchURL(String number) async {
if (await canLaunch(number)) {
await launch(number);
} else {
throw 'Could not launch $number';
}
}
只需简单地用一个数字启动
解决方案
请参阅此链接以获取答案。有用。基本上,您需要在清单中添加相关权限,您就完成了。
<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>
推荐阅读
- spring-boot - 如何对我的服务类进行删除测试?
- sql - 在雪花的最终结果集中需要不同的列名
- java - 如何从 Firebase 实时数据库中检索具有 UID 的特定用户的特定数据
- vb.net - 是否可以在visual basic中获得下周一和周日的日期?
- python - 数组中的 Python 对象
- salt-stack - 如何在不运行命令的情况下检查命令将针对哪些奴才?
- java - 更新数组列表的最佳实践(Java/Spring Boot)
- mysql - MySQL - 总和正在成倍增加
- bro - Zeek 不存储文件,即使在加载脚本之后也是如此。我错过了什么?
- node.js - 何时使用 container.get 与构造函数 @inject?