rohfosho / CordovaCallNumberPlugin

Call a number directly from your cordova application.
MIT License
185 stars 151 forks source link

Is it possible to populate the phone number but not dial? #79

Open wenindoubt opened 4 years ago

wenindoubt commented 4 years ago

Based on the documentation, it seems like when the Call Number service is called, it immediately dials the phone number using the native phone app.

Is it possible to only populate the phone number in the native phone app, and allow the user to manually press the call button?

  public onOpenPhone(phoneNumber: string): void {
    this.callNumber.callNumber(phoneNumber, true);
  }
wenindoubt commented 4 years ago

I am still running into this issue if someone could help out.

Djunnni commented 4 years ago

i think it is trouble . i'm revising code and testing. i will request PR this week.

Djunnni commented 4 years ago

Now you can use : )

wenindoubt commented 4 years ago

Now you can use : )

Thank you! Would you kindly provide a simple example of how I would use this plugin and only populate the number and not dial?

Djunnni commented 4 years ago

if bypassAppChooser is true, go to dial now else if bypassAppChooser is false, call directly

it's easy

darkoandreev commented 3 years ago

I tried it with bypassAppChooser=true, but it's still not working. It's calling the number directly and I don't want that. I want only to show the number in the dialer app and then to allow the user clicking on the green phone button to make the call. Do you know what is the problem? I'm using the latest Android version. @Djunnni @wenindoubt

wenindoubt commented 3 years ago

I tried it with bypassAppChooser=true, but it's still not working. It's calling the number directly and I don't want that. I want only to show the number in the dialer app and then to allow the user clicking on the green phone button to make the call. Do you know what is the problem? I'm using the latest Android version. @Djunnni @wenindoubt

@darkoandreev I actually worked around this by using location.href.

  public openPhone(phoneNumber: string): void {
    location.href = `tel:${phoneNumber}`;
  }

That will populate the phone number but not dial it :)

darkoandreev commented 3 years ago

I tried it with bypassAppChooser=true, but it's still not working. It's calling the number directly and I don't want that. I want only to show the number in the dialer app and then to allow the user clicking on the green phone button to make the call. Do you know what is the problem? I'm using the latest Android version. @Djunnni @wenindoubt

@darkoandreev I actually worked around this by using location.href.

  public openPhone(phoneNumber: string): void {
    location.href = `tel:${phoneNumber}`;
  }

That will populate the phone number but not dial it :)

It works on both operating systems (Android and iOS). It's more like a workaround, but it's working. Thank you!