Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: When I use the add photos only permission, the returned permission is always isGranted #1402

Closed
3 of 5 tasks
ShineYangGod opened this issue Nov 6, 2024 · 2 comments
Assignees
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.

Comments

@ShineYangGod
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

When I use the add photos only permission, the returned permission is always isGranted

Expected results

The expectation is that it should return normal, and that it should return isDenied when I reject it.

Actual results

flutter: The permissions obtained are=========PermissionStatus.granted
flutter: Allow photo saving permissions

Code sample

Permission permission;

if (await Permission.photosAddOnly.isRestricted ||
await Permission.photosAddOnly.isPermanentlyDenied) {
permission = Permission.photosAddOnly;
} else {
permission = Permission.storage;
}
// 检查权限状态
var status = await permission.status;

if (status.isDenied) {
// 如果权限被拒绝,请求权限
status = await permission.request();
}
print('The permissions obtained are=========$status');
if (status.isGranted) {
print('Allow photo saving permissions');
onJumpTab();
SensorsUtil.instance.track(
eventName: "permission_accept", properties: {"type": "选取手机照片授权"});
} else if (status.isDenied) {
// 权限被拒绝
print("Permission denied. Cannot save photos to the album.");
SensorsUtil.instance.track(
eventName: "permission_reject", properties: {"type": "选取手机照片授权"});
} else if (status.isPermanentlyDenied) {
// 权限被永久拒绝,需要去设置页面手动开启
SensorsUtil.instance.track(
eventName: "permission_reject", properties: {"type": "选取手机照片授权"});
openAppSettings();

}

Screenshots or video

Screenshots or video demonstration

[Upload media here]

![IMG_B2FB42CEFADE-1](https://github.com/user-attachments/assets/adc7ea14-31d9-40c0-aec0-d310e57f58c9)

Version

11.3.1

Flutter Doctor output

flutter: The permissions obtained are=========PermissionStatus.granted
flutter: Allow photo saving permissions

@TimHoogstrate
Copy link
Contributor

Dear @ShineYangGod,

Do you still have the issue? I cannot reproduce this.

Kind regard,

@TimHoogstrate TimHoogstrate self-assigned this Dec 11, 2024
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Dec 11, 2024
Copy link

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Dec 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.
Projects
None yet
Development

No branches or pull requests

2 participants