I'm simply running this code on the componentDidMount method:
checkPermissions = async () => {
Permissions.check('location', { type: 'whenInUse' }).then((response) => {
console.tron.log(`locationPermission: ${response}`);
},
(error) => {
console.tron.error(`There has been a problem with your fetch operation: ${error.message}`);
}).catch(error => console.tron.error(error)); // error handling for promise
}
Nothing appears... just get this error on reactotron:
line: 153447
column: 28
sourceURL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false
I'm using all UsageDescriptions in my info.plist and it does not work:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Some description</string>
<key>NSCalendarsUsageDescription</key>
<string>Some description</string>
<key>NSCameraUsageDescription</key>
<string>Some description</string>
<key>NSLocationUsageDescription</key>
<string>GPS data is required to verify your commutes and generate rewards.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Permitir acesso a sua localiza莽茫o para encontrarmos os prestadores mais pr贸ximos.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Permitir acesso a sua localiza莽茫o para encontrarmos os prestadores mais pr贸ximos.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Some description</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Some description</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Some description</string>
<key>NSAppleMusicUsageDescription</key>
<string>Some description</string>
<key>NSMotionUsageDescription</key>
<string>Some description</string>
encountering the same error using Android
Any fix for this?
It's getting undefined
Please check this. I will work.
Permissions.request('location').then(response => {
// Returns once the user has chosen to 'allow' or to 'not allow' access
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({cameraPermission: response});
});
I am closing this since this issue does not exists anymore with the 2.0.0 release.
Most helpful comment
encountering the same error using Android