rohfosho / CordovaCallNumberPlugin

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

[android][solve : #79] User can select Call direct or Go to Dial #81

Closed Djunnni closed 4 years ago

Djunnni commented 4 years ago

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

as you know, isTelephonyEnabled is only work when TelephonyManager is not PHONE_TYPE_NONE tm.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE

and user manually can't go Call Dial. so i revise Intent for User who can select Call Directly or Go to Dial Intent intent = new Intent(isTelephonyEnabled() ? gotoDialer(bypassAppChooser) : Intent.ACTION_VIEW);

and make a function CallDirect() private String gotoDialer(boolean type) { return type ? Intent.ACTION_DIAL : Intent.ACTION_CALL; } NOW user can go dial when bypassAppChooser is true