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

🐛 Fix mediaLocation = true does not work on Android API 34 #1205

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

chocoyang-horizon
Copy link
Contributor

mediaLocation = true does not work when the app already has common permissions on Android API 34

@AlexV525
Copy link
Member

Does "not work" indicate that permission for the media location won't be requested in this case?

@chocoyang-horizon
Copy link
Contributor Author

Yes, havePermissions(context, requestType) is true and returned, it will not check whether there is mediaLocation permission, resulting in no dynamic request for mediaLocation permission when there is no mediaLocation permission.

@AlexV525 AlexV525 merged commit bd48e50 into fluttercandies:main Oct 15, 2024
12 of 13 checks passed
@chocoyang-horizon
Copy link
Contributor Author

How to reproduce:

The app has not used the mediaLocation permission in the past.

final state = await PhotoManager.requestPermissionExtend();

Now the app requires the mediaLocation permission, but the plugin doesn't actually request the mediaLocation permission dynamically.

final state = await PhotoManager.requestPermissionExtend(
  requestOption: const PermissionRequestOption(
    androidPermission: AndroidPermission(
      type: RequestType.common,
      mediaLocation: true,
    ),
  ),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants