我正在开发和开发具有拨打电话号码功能的应用程序。当我单击“呼叫”按钮时,它将转到拨号盘,当我们通过“后退”按钮将其取消并恢复我们的应用程序时,该应用程序将冻结,并且无论我们在屏幕上的何处触摸都不会发生任何事情。我在呼叫按钮点击时使用的以下代码。
方法1:
window.open('tel:' + this.contactNo, '_system');
方法2:
this.callNumber.callNumber(this.contactNo, true)
.then( (data) =>
{
console.trace("called callnumber ", data);
})
.catch( (error) =>
{
console.log('Error launching dialer',error);
});
我尝试过两种方法,但结果相同。任何帮助。在此先感谢
所以我试图复制问题,但没有成功。
i遵循了“离子电话号码”软件包,Call number From Ionic Framework这是我的解决方案。
组件
async openCallModal(){
this.callNumber.callNumber("18001010101", true)
.then(res => console.log('Launched dialer!', res))
.catch(err => console.log('Error launching dialer', err));
}
查看/ HTML
<ion-content>
<ion-button (click)="openCallModal()" color="primary">Call</ion-button>
</ion-content>