cssivision / react-native-qrcode

a minimalist qrcode component for react-native
MIT License
853 stars 304 forks source link

QR code is not scannable #45

Open rohitgoyal opened 6 years ago

rohitgoyal commented 6 years ago

QR code is generating successfully but I am not able to scan it. I tried scanning the QR code using multiple apps but none could read it. Any ideas why?

This is my code

<QRCode
          value={"Hello World"}
          size={200}
          bgColor='white'
          fgColor='black'/>
Sumanthjois commented 6 years ago

I am facing the same issue

JoyHou commented 6 years ago

What did you get from scanning? Null?

Knight704 commented 6 years ago

@rohitgoyal, where have you put your QRCode component, how it is rendered? Chances are you have background without sufficient contrast. I also had this problem reported in some cases, and found that it was due to black bg. Solved by adding addtional white layer under QR code

mrarronz commented 5 years ago

This is a bug and never be fixed, I have removed the dependency from my project.

react-native-qrcode-svg is more reliable and works well, strongly recommend this library, hope it's not too late to post my solution here.

Any other guys who are facing the same issue should follow react-native-qrcode-svg, this is the right way to solve your problem!!

j-ornelas commented 5 years ago

@mrarronz ALL sides of the QR Code need to have a high contrast background. My QR Code background was white and the code was black, but since the entire code was placed on a blue background, the code would not scan.

This would NOT scan:

screen shot 2018-07-18 at 11 26 52 am

However, this worked perfectly:

screen shot 2018-07-18 at 11 25 58 am

Hopefully that helps your issue.

mrarronz commented 5 years ago

@j-ornelas I generate the QR Code with white background color, it cannot be recognized at all. A library should be stable and reliable, if it often works not well as expected, then I don't think it's good enough to use. react-native-qrcode-svg is a better solution.

SnehalAgrawal commented 4 years ago

Updated Generation of QR Code in React Native to react-native-qrcode-svg