Ionic Native Barcode Scanner issue


#1

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.


#2

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Safari dev tools: https://ionic.zone/debug/remote-debug-your-app#ios Look at the console and network tabs for errors.


#3

I could resolve this problem this way. The function encode return an object with key, so I created my own modal page and I took this key and passed for my modal page