Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async componentDidMount() {
try {
const authorizedLocation = await getAuthorizedLocationAsync();
this.setState({ locationName: authorizedLocation.name });
} catch (ex) {
if (__DEV__) {
Alert.alert(ex.debugCode, ex.debugMessage);
} else {
Alert.alert(ex.code, ex.message);
}
}
}