Hi,
Sorry I am very green and new to ionic but getting there slowly. I cant find on google or this forum an answer to my question…
emergency() {
this.loaderService.show('Alerting neighbors...');
// Inside here we take some other actions
}
async presentAlertConfirm() {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'EMERGENCY!',
message: 'Confirm to send alerts to neighbors with your location and dial <strong>111</strong>!!!',
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel: cancelled sending alerts');
}
}, {
text: 'Okay',
handler: (EMERGENCY) => {
console.log('Confirm Okay');
//emergency();
//this.callNumber.callNumber("111", true)
// .then(res => console.log('Launched dialer!', res))
// .catch(err => console.log('Error launching dialer', err));
}
}
I cant seem to find how to have the “Okay” button call the emergency function.
Many thanks in advance
Barry