Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
Genere una imagen de código QR para compartir a partir de un valor de código QR

Tengo por ejemplo un QRCode SMS con el valor:

SMSTO:99999999:Hola mundo

Y quiero generar una imagen de código QR para poder compartirla con react-native-share. ¿Cómo podría hacer eso?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pasos: instale react-native-qrcode-image

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

Instalar reaccionar-nativo-compartir

 npm install react-native-share --save

Vincularlo con la aplicación

 react-native link react-native-share

Use QRCode en su componente

 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;

Cortesía: https://stackoverflow.com/a/53219478/17632251

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!