Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Barcode Scanner Orientation #10863

Closed
dondragon2 opened this issue Oct 29, 2020 · 10 comments
Closed

Android Barcode Scanner Orientation #10863

dondragon2 opened this issue Oct 29, 2020 · 10 comments
Labels

Comments

@dondragon2
Copy link

I am using expo-barcode-scanner in a bare react native application. It works fine on iOS but on Android I noticed that it only scans if I turn the phone horizontally. How can I make it scan from any orientation or even just from portrait?

I am using:
expo-barcode-scanner: ^9.0.0

@dondragon2 dondragon2 changed the title Android Barcode Scanner Android Barcode Scanner Orientation Oct 29, 2020
@byCedric
Copy link
Member

Hi @dondragon2, thanks for the issue but without a repro I'm not sure what's going on. Could you provide one? If I use the example from the docs, I can scan barcodes in both portrait and landscape.

@byCedric byCedric added Android BarCodeScanner Requesting changes to issue Issue author must address maintainer feedback labels Oct 29, 2020
@dondragon2
Copy link
Author

dondragon2 commented Oct 29, 2020

@byCedric below is the code that I am using.

Also I am using ZxingBarCodeScanner

import { BarCodeScanner } from 'expo-barcode-scanner';
import React from 'react';
import { View } from 'react-native';
import BarcodeMask from 'react-native-barcode-mask';

interface IProps {
  onScanned?: (payload: any) => void;
  allowedTypes?: string[] | number[];
}

const Scanner: React.FC<IProps> = ({ onScanned, allowedTypes }) => {
  return (
    <View style={{flex: 1}}>
      <BarCodeScanner
        onBarCodeScanned={onScanned}
        style={StyleSheet.absoluteFill}
        barCodeTypes={allowedTypes as string[]}
      >
        <BarcodeMask/>
      </BarCodeScanner>
    </View>
  );
};```

@rubyte-s
Copy link

rubyte-s commented Dec 7, 2020

Im seeing the same issue on android, barcode will scan when holding the phone in portrait and the barcode is vertical.

image

However will not scan when phone is portrait and barcode horizontal

image

Repo: https://github.com/rubyte-s/RNBarcodeExample

@lis-hs
Copy link

lis-hs commented Aug 12, 2021

I also have this problem. In addition to scanning the QR code, the bar code of the mobile phone needs to be scanned vertically

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2022

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Feb 3, 2022
@github-actions
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@mxcihak
Copy link

mxcihak commented Feb 17, 2022

Same problem

@keithdmoore
Copy link

Same here

@mayying
Copy link

mayying commented Jul 26, 2023

+1

@bohdan-vasylenko
Copy link

had to switch to expo-camera because of this issue.
expo-camera also has built-in barcode scanner

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants