颤音:获取当前已启用哪种类型的位置权限
嘿,我正在使用权限处理程序软件包,以便请求并获得我的权限的当前状态。 我现在有以下三个权限
[Permission.location, Permission.locationWhenInUse, Permission.locationAlways]
,我想知道当前使用的哪个权限。 由于某种原因,我尝试做这样的事情
List<PermissionStatus> status = await Future.wait(permissionTypes.map(
(permission) async => await permission.request(),
));
,我收到
[PermissionStatus.granted, PermissionStatus.granted, PermissionStatus.granted]
我的目标是知道是否拒绝了许可,仅拒绝或始终如一。
关于如何实现这一目标有什么想法?
Hey I am using the permission handler package in order to request and get the current status of my permissions.
I have the following three permissions
[Permission.location, Permission.locationWhenInUse, Permission.locationAlways]
Now I want to know which of those is currently the one in use.
I tried doing something like this
List<PermissionStatus> status = await Future.wait(permissionTypes.map(
(permission) async => await permission.request(),
));
For some reason I receive
[PermissionStatus.granted, PermissionStatus.granted, PermissionStatus.granted]
My goal is to know if the permission is denied, onlyWhenInUse or always.
Any ideas on how to achieve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论