android - 应该使用什么作为 url_launcher 中的 url 以使颤振应用程序在设备上打开内置摄像头?
问题描述
我了解到我们可以从 url_launcher 启动谷歌地图、电子邮件和Skype。在手机内置的相机应用程序中打开的 URL 应该是什么?
Android 和 iOS 都可以吗?
const url = 'https://www.google.com/maps/search/?api=1&query=52.32,4.917';
const url1 = 'cam:'; //what should be this url?
if (await canLaunch(url1)) {
await launch(url1);
} else {
throw 'Could not launch $url';
}
解决方案
实际上,你不能从url_launcher打开相机,你需要一个名为image_picker的包,这样你就可以从内置的相机中获取图片或视频。
推荐阅读
- mysql - 如何用一种形式在4个表中插入数据
- spinnaker - 错误:runKubernetesJobAtomicOperationDescription.application.invalid(必须匹配 ^[a-z0-9]+$)
- android - 如何在菜单项之间设置 BottomNavigationBar 等间距?
- firebase-realtime-database - 数据未保存在 Firebase 数据库中
- java - 需要转换成二维数组的String ArrayList
- lodash - Lodash链函数的调试
- html - 如何保留空格?
- reactjs - 失败的道具类型:道具`children`在`Mutation`中标记为必填,但其值为`undefined`
- python - 如何创建一个按钮,如果您按下它会继续运行您的代码,但如果您单击其他地方会破坏它?
- r - 从一列中使用 R 中的 difftime