Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic Native Barcode Scanner issue

$
0
0

@undercovergeek wrote:

I have a simple implementation of the Ionic Native barcode scanner. The issue is I'm using the encode feature of the scanner and for some odd reason it does not show the QR Code popup on iOS like it does on Android. I can see in the console that it creates the jpeg but it does not show the QR Code. Below is the code that I have:

import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { BarcodeScanner ,BarcodeScannerOptions } from '@ionic-native/barcode-
scanner';

 @Component({
 selector: 'page-home',
 templateUrl: 'home.html'
   })
    export class HomePage {
     scanData : {};
     encodeData : string ;
     encodedData : {} ;
     options :BarcodeScannerOptions;
        constructor(public navCtrl: NavController, public navParams: NavParams,private barcodeScanner: BarcodeScanner) {
       }

 scan(){
    this.options = {
       prompt : "Scan your barcode "
     }
     this.barcodeScanner.scan(this.options).then((barcodeData) => {

         console.log(barcodeData);
         this.scanData = barcodeData;
        }, (err) => {
        console.log("Error occured : " + err);
      });
     }
    encodeText(){
this.barcodeScanner.encode(
this.barcodeScanner.Encode.TEXT_TYPE,this.encodeData).then((encodedData) => {

    console.log(encodedData);
    this.encodedData = encodedData;

}, (err) => {
    console.log("Error occured : " + err);
  });
 }
}

Below is the result for android after hitting the encode button. iOS does nothing. has anyone had this happen? I searched Google and nothing.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>