Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

332
Visualizações
Generate a QRCode image to share from a QR Code value

I have for example a SMS QRCode with the value:

SMSTO:99999999:Hello World

And I want to generate a QR code image so I'm able to share it with react-native-share. How could I do that?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Steps: install react-native-qrcode-image

npm install git+https://github.com/Kishanjvaghela/react-native-qrcode-image.git --save

Install react-native-share

npm install react-native-share --save

Link it with app

react-native link react-native-share

Use QRCode in your component

import QRCode from 'react-native-qrcode-image';
import Share from 'react-native-share';

class Dashboard extends React.Component {
  static navigationOptions = {
    title: Strings.dashboardTitle
  };

  constructor(props) {
    super(props);
    this.qrCode = '';
  }

  openShareScreen() {
    if (this.qrCode) {
      const shareOptions = {
        type: 'image/jpg',
        title: '',
        url: this.qrCode
      };
      Share.open(shareOptions)
        .then(res => console.log(res))
        .catch(err => console.error(err));
    }
  }

  render() {
    const { type, address } = this.state;
    return (
      <TouchableHighlight onPress={this.openShareScreen}>
        <View>
          <QRCode
            getBase64={base64 => {
              this.qrCode = base64;
            }}
            value={address}
            size={150}
            bgColor="#FFFFFF"
            fgColor="#000000"
          />
        </View>
      </TouchableHighlight>
    );
  }
}

export default Dashboard;

Courtesy: https://stackoverflow.com/a/53219478/17632251

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda