简体   繁体   中英

Ionic 4 android app freeze when resume after call function

I am developing and app which has feature of calling a number. When i click call button it goes to dial pad and when we cancel it by back button and resumes our app then it freezes and nothing happens wherever we touch on screen. Below code i have used on call button click.

Method 1:

window.open('tel:' + this.contactNo, '_system');

Method 2:

  this.callNumber.callNumber(this.contactNo, true)
      .then( (data) =>
      {
        console.trace("called callnumber ", data);
      })
      .catch( (error) =>
      {
        console.log('Error launching dialer',error);
      });

I have tried both methods but same result. Any help. Thanks in advance

so i tried to replicate the issue but don't have any success on doing so.

i followed the Ionic Call Number package, Call number From Ionic Framework This were my solution.

Component

 async openCallModal(){
    this.callNumber.callNumber("18001010101", true)
        .then(res => console.log('Launched dialer!', res))
        .catch(err => console.log('Error launching dialer', err));
  }

View / HTML

<ion-content>
  <ion-button (click)="openCallModal()" color="primary">Call</ion-button>
</ion-content>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM