question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QRcode is not read

See original GitHub issue

What’s happening?

I’m starting with this library. I copied exactly the code that is made available from the documentation however when executing it I have no answer. Not even the vibration produced by reading Qrcode is performed

How can it be reproduced?

import React, { Component } from 'react';
import { View, Text, Dimensions, StyleSheet, TouchableOpacity, } from 'react-native';
import QRCodeScanner from "react-native-qrcode-scanner";


export default class QRcodeScan extends Component {
  
  onSuccess = (e) => {
    console.log(e)
  }

  render() {
    return (
      <QRCodeScanner
        onRead={this.onSuccess}
        topContent={
          <Text style={styles.centerText}>
            Go to <Text style={styles.textBold}>wikipedia.org/wiki/QR_code</Text> on your computer and scan the QR code.
          </Text>
        }
        bottomContent={
          <TouchableOpacity style={styles.buttonTouchable}>
            <Text style={styles.buttonText}>OK. Got it!</Text>
          </TouchableOpacity>
        }
      />
    );
  }
}

const styles = StyleSheet.create({
  centerText: {
    flex: 1,
    fontSize: 18,
    padding: 32,
    color: '#777',
  },
  textBold: {
    fontWeight: '500',
    color: '#000',
  },
  buttonText: {
    fontSize: 21,
    color: 'rgb(0,122,255)',
  },
  buttonTouchable: {
    padding: 16,
  },
});

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
TeruyaHaroldocommented, Dec 11, 2019

I am using the react-native-camera version 3.8.0 and everything is working.

const { height, width } = Dimensions.get('window');

<Camera
  style={{ height: height, width: width }}
  onBarCodeRead={(e) => console.log(e.data)}            
  androidCameraPermissionOptions={null}
  pendingAuthorizationView={<My View behind the dialog that is asking for permission />}
  notAuthorizedView={<My View that shows that user declined permission />}
>
</Camera>

0reactions
GhayoorUlHaqcommented, Mar 2, 2021

I am using the react-native-camera version 3.8.0 and everything is working.

const { height, width } = Dimensions.get('window');

<Camera
  style={{ height: height, width: width }}
  onBarCodeRead={(e) => console.log(e.data)}            
  androidCameraPermissionOptions={null}
  pendingAuthorizationView={<My View behind the dialog that is asking for permission />}
  notAuthorizedView={<My View that shows that user declined permission />}
>
</Camera>

Not worked for me 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

9 reasons Why Your QR Code is Not Working - Beaconstac blog
Even the most advanced QR Code scanners cannot scan QR Codes if not created correctly. Or was it the faulty QR Code generator?...
Read more >
6 reasons why your QR code is not working - QRCode Monkey
Avoid breaking your QR code by being aware of a few things. Here are 6 things that can cause trouble when scanning your...
Read more >
Unable to Scan QR Code? Here's How to Fix a QR Code.
If a QR code won't scan, it could be because the QR code error correction level is too low for the amount of...
Read more >
12 Reasons why your QR code is not working
QR codes are not working for a variety of reasons. These codes are developed to be scanned by smartphone gadgets.
Read more >
Troubleshoot QR code scanning with your phone's camera
Use brighter lighting. Your phone or tablet will not use the flash when scanning a QR code with the Nest app, so bright...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found