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

Description
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