Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Location permissions for Android are not being prompted #23

@josectobar

Description

@josectobar

I noticed that the location permissions were not prompting when I test my app on a fresh build on Android, this would cause an error 2 when trying to connect to the network, I was able to get it fixed by adding the permissions in a function before prompting to connect:

const checkAndroidLocationPermissions = async () => {
    const permissionResult = await PermissionsAndroid.request(
      PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
      {
        title: 'myApp needs access to your location',
        message: `we need access to your location in order to connect to your wifi network.`,
        buttonNeutral: 'Ask Me Later',
        buttonNegative: 'Cancel',
        buttonPositive: 'OK',
      },
    )
    if (permissionResult !== 'granted') {
      handleError(permissionResult)
    }
  }

Phone details:

Model: Pixel 3a
Android version: 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions