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

331
Views
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 answers
Answer question

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 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!