How to use the react-native-square-reader-sdk.startReaderSettingsAsync 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 / SettingScreen.js View on Github external
async onStartReaderSettings() {
    const { navigate } = this.props.navigation;
    try {
      await startReaderSettingsAsync();
    } catch (ex) {
      let errorMessage = ex.message;
      switch (ex.code) {
        case ReaderSettingsErrorSdkNotAuthorized:
          // Handle reader settings not authorized
          navigate('Deauthorizing');
          break;
        case UsageError:
        default:
          if (__DEV__) {
            errorMessage += `\n\nDebug Message: ${ex.debugMessage}`;
            console.log(`${ex.code}:${ex.debugCode}:${ex.debugMessage}`);
          }
          Alert.alert('Error', errorMessage);
          break;
      }