Cant show QRScanner Preview Camera

In my app I’m using the cordova-qr-scaner plugin. I know that to make the camera view appear we have to remove the views from the pages above.

In my app I have two pages that access the reading method, login page and home page.

I made a control variable to know if the horigem page is the home page or not. If yes when calling QRScanner it hides the visualization of the login page, the home page and the viewer page, if not, then the page that called is the login page, when calling the read QR function only two views are removed, that of the viewer and the login page.

For some reason everything works normally on android but when i am on the home page on ios and i call the read method qr a blank page appears

Login page:

lerQR(){
    this.apiService.setPagina(false);
}

Home page:

lerQR(){
    this.apiService.setPagina(true); 
}

Service:

   setPagina(paginaHome){
    this.igualPaginaHome = paginaHome;
    this.nav.navigateForward('leitor-qr')
   }
 
   getPagina(){
     return this.igualPaginaHome;
   }

Page QRScanner:

import { Component, OnInit } from '@angular/core';
import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner/ngx';
import { NavController, Platform } from '@ionic/angular';
import { Subscription } from 'rxjs';
import { ApiService } from 'src/app/services/api.service';

@Component({
  selector: 'app-leitor-qr',
  templateUrl: './leitor-qr.page.html',
  styleUrls: ['./leitor-qr.page.scss'],
})
export class LeitorQRPage implements OnInit {

  public leitorQR: any;
  public pgLogin: HTMLElement;
  public pgHome : HTMLElement;
  public pgAtual : HTMLElement;
  dadosretorno:any; 
  nome: any; 
  unidade;
  valorQR: any;
  leuQR = false;
  paginaHome: Boolean;

  constructor(
    private apiService : ApiService,
    private qrScanner: QRScanner, 
    private nav : NavController,
    private platform : Platform
  ){}

  ngOnInit() {
    this.paginaHome = this.apiService.getPagina();
  }
  ionViewWillEnter(){
    this.lerQR();
  }
  private backButtonSub: Subscription;
  ionViewDidEnter(){
    this.backButtonSub =  this.platform.backButton.subscribeWithPriority(0, () => {
      this.cancelaQR();
      this.nav.pop();      
    });
  }


  lerQR(){
    this.qrScanner.prepare()
    .then((status: QRScannerStatus) => {
      if (status.authorized) {
        if (this.paginaHome) {
          this.pgLogin = document.getElementsByTagName('ion-content')[0] as HTMLElement;
          this.pgHome = document.getElementsByTagName('ion-content')[1] as HTMLElement;
          this.pgAtual = document.getElementsByTagName('ion-content')[2] as HTMLElement;
          this.pgLogin.style.opacity = '0';
          this.pgHome.style.opacity = '0';
          this.pgAtual.style.opacity = '0';
        } else{
          this.pgLogin = document.getElementsByTagName('ion-content')[0] as HTMLElement;
          this.pgAtual = document.getElementsByTagName('ion-content')[1] as HTMLElement;
          this.pgLogin.style.opacity = '0';
          this.pgAtual.style.opacity = '0';
        }
        
        this.leuQR = true;
        this.qrScanner.show();

        // start scanning
        this.leitorQR = this.qrScanner.scan().subscribe((text: string) => {
          this.cancelaQR();
          console.log('ok')
        });

      } else if (status.denied) {
        this.qrScanner.openSettings();
      } else {
        // permission was denied, but not permanently. You can ask for permission again at a later time.
      }
    })
    .catch((e: any) => console.log('Error is', e));
  }

  cancelaQR(){
    this.leuQR = false;
    if (this.paginaHome) {
      this.pgLogin.style.opacity = '1';
      this.pgHome.style.opacity = '1';
      this.pgAtual.style.opacity = '1';
    } else {
      this.pgLogin.style.opacity = '1';
      this.pgAtual.style.opacity = '1';
    }
    this.nav.back();
    this.qrScanner.hide(); // hide camera preview
    this.leitorQR.unsubscribe(); // stop scanning
  }
  ionViewWillLeave() {
    this.backButtonSub.unsubscribe();
  }
}