react-native-iot-wifi
react-native-iot-wifi copied to clipboard
Location permissions for Android are not being prompted
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
Very good, resolved my problem too.
I'm problem try generation apk release. Help please
`Task :react-native-iot-wifi:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-iot-wifi:verifyReleaseResources'.
1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed /home/marco/Documentos/Kaios/fileShareSmartphone/node_modules/react-native-iot-wifi/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. /home/marco/Documentos/Kaios/fileShareSmartphone/node_modules/react-native-iot-wifi/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. /home/marco/Documentos/Kaios/fileShareSmartphone/node_modules/react-native-iot-wifi/android/build/intermediates/res/merged/release/values/values.xml:2661: error: resource android:attr/fontVariationSettings not found. /home/marco/Documentos/Kaios/fileShareSmartphone/node_modules/react-native-iot-wifi/android/build/intermediates/res/merged/release/values/values.xml:2662: error: resource android:attr/ttcIndex not found. error: failed linking references. `
@marcobneves , I have the same issue, where you able to fix this?