@napacitor/phone-dialer
Phone dialer plugin wrapping the .NET MAUI PhoneDialer API: place phone calls.
Installation
To use npm:
npm install @napacitor/phone-dialer
To use yarn:
yarn add @napacitor/phone-dialer
Sync native files:
npx nap sync
Usage
import { PhoneDialer } from '@napacitor/phone-dialer';
// Check for support
const { supported } = await PhoneDialer.isSupported();
if (supported) {
await PhoneDialer.open({ number: '+8613800138000' });
}
How It Works
Wraps the .NET MAUI PhoneDialer.Default.IsSupported / Open facade, opening the system dialer. open() throws UNSUPPORTED when the device does not support it.
Permissions
Android
No additional configuration required (dialing goes through a system Intent, the call is not placed directly).
iOS
No additional configuration required.
Windows
No additional configuration required.
API
isSupported()
Checks whether placing phone calls is supported.
Returns: Promise<PhoneDialerSupportedResult>
open(options)
Places a phone call (opens the system dialer; throws UNSUPPORTED when the device does not support it).
| Param | Type |
|---|---|
options | DialOptions |
Returns: Promise<void>
Interfaces
DialOptions
| Prop | Type | Description |
|---|---|---|
number | string | Phone number (must not be empty, otherwise INVALID_ARGUMENTS is thrown). |
PhoneDialerSupportedResult
| Prop | Type | Description |
|---|---|---|
supported | boolean | Whether the current device supports placing phone calls. |