How to use the react-native-square-reader-sdk.getAuthorizedLocationAsync function in react-native-square-reader-sdk

To help you get started, we’ve selected a few react-native-square-reader-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github square / react-native-square-reader-sdk / reader-sdk-react-native-quickstart / app / screens / CheckoutScreen.js View on Github external
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);
      }
    }
  }