Skip to content

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

Closed

Description

@fabyeah

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.

Activity

  1. self-assigned this
    on Aug 6, 2021
  2. safaiyeh commented on Aug 6, 2021

    @safaiyeh
    Contributor

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

  3. makivan8 commented on Sep 27, 2021

    @makivan8

    @safaiyeh any updates?

  4. locked as resolved and limited conversation to collaborators on Oct 12, 2022
  5. added
    Resolution: Locked
    on Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

API: PermissionsAndroidPlatform: AndroidResolution: Locked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions