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

PermissionsAndroid.PERMISSIONS.ACCESS_MEDIA_LOCATION isn't implemented yet? #31953

Closed
fabyeah opened this issue Aug 4, 2021 · 2 comments
Closed
Assignees
Labels
API: PermissionsAndroid Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@fabyeah
Copy link

fabyeah commented Aug 4, 2021

I need to access the location info of user's videos and images.

Since Android 10 (API level 29) it is necessary to request ACCESS_MEDIA_LOCATION permission to access media location tags: https://developer.android.com/training/data-storage/shared/media#media-location-permission

But when I request the permission, I get an error:

Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference

Basically the same error as when requesting any non-existing permission string.

The permission is also missing from this list, even though it is rated as 'dangerous':
https://reactnative.dev/docs/permissionsandroid#permissions-that-require-prompting-the-user

So I'm guessing this permission isn't implemented in PermissionsAndroid yet? Is there any way to get this to work / work around this?

React Native version:

0.64.1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Add permission to Manifest: <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
  2. Request permission:
    const granted = await PermissionsAndroid.request(
      PermissionsAndroid.PERMISSIONS.ACCESS_MEDIA_LOCATION,
      {
        title: 'Need media location permission',
        message: 'App needs to access the location info of your video',
        buttonNeutral: 'Ask Me Later',
        buttonNegative: 'Cancel',
        buttonPositive: 'OK',
      },
    );

Expected Results

Show prompt to grant permission.

@safaiyeh
Copy link
Contributor

safaiyeh commented Aug 6, 2021

@fabyeah thanks for the issue, yup looks like this permission is not supported yet. I'll take a look (no promises ill finish).

@makivan8
Copy link

@safaiyeh any updates?

@facebook facebook locked as resolved and limited conversation to collaborators Oct 12, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: PermissionsAndroid Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants