Call Number - not working

Hi,
i have a problem with Ionic Native “Call Number”, when a call this function on android system not open Dialer (no error show). When i call this function on “web browser (firefox)” got error “cordova is not installed”.

Ionic info:

cli packages:
    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:
    cordova (Cordova CLI) : 7.0.0 

local packages:
    @ionic/app-scripts : 1.3.12
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.7.1

System:
    Android SDK Tools : 26.0.2
    Node              : v6.11.3
    npm               : 3.10.10 
    OS                : Linux 4.4

Misc:
    backend : legacy

package.json:

"@angular/animations": "4.4.3",
        "@angular/common": "4.4.3",
        "@angular/compiler": "4.4.3",
        "@angular/compiler-cli": "4.4.3",
        "@angular/core": "4.4.3",
        "@angular/forms": "4.4.3",
        "@angular/http": "4.4.3",
        "@angular/platform-browser": "4.4.3",
        "@angular/platform-browser-dynamic": "4.4.3",
...
"@ionic-native/call-number": "^4.3.0",
...
"call-number": "~0.0.2"
...

code.ts

if(phones.length > 0) {
          for(let phone of phones) {
            buttons.push({
              text: phone,
              icon: 'call',
              handler: () => {
                this.callNumber.callNumber(phone, true)
                  .then(() => alert('Launched dialer:' + phone))
                  .catch((e) => alert('Failed dialer:' + phone + ' | e: ' + e));
              }
            });
          }
        }

I have the same, it stopped working after last framework 3.7 update


    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 25.2.5
    Node              : v6.9.2
    npm               : 5.3.0
    OS                : Windows 7

It stopped working even before.

I have 3.6.1 and I have the exact same behavior. I try to force install and now I can’t even install it. I get https://github.com/Rohfosho/CordovaCallNumberPlugin.git not found.

Anyone has any clue?

I don’t think you need to. If you have the in app browser it’ll launch the dialler anyway.

callNumber(){
 setTimeout(() => {
      let tel = '12345678890';
      window.open(`tel:${tel}`, '_system');
    },100);
}

I tend to put into a timeout as it allows the button to do its click animation whilst the phone thinks about the action you’ve requested.

3 Likes

Nice idea…

I’ll try it

Thanks

Thanks, I try it to, but ionic 3.7.1 has more bug and wait for fix it… when i back to 3.6.1 “call-number” working fine for me…

Great
I’ll try it.
Thank you.

call() {
    let tel_number = '9870684933'
    window.open(`tel:${tel_number}`, '_system')
  }

This works ! thanks a lot man :slight_smile: