diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index dc54b14b351dc85a09abd394681bd1dd2d182568..33ea80fda600d889e265ace58cb3de2b5f0d19fb 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -23,10 +23,10 @@ Initiates a call. This function uses an asynchronous callback to return the exec **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------- | -| phoneNumber | string | Yes| Phone number.| -| callback | AsyncCallback<boolean> | Yes| Callback used to return the result.
- **true**: success
- **false**: failure| +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -49,11 +49,11 @@ Initiates a call. You can set call options as needed. This function uses an asyn **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------- | -| phoneNumber | string | Yes| Phone number.| -| options | DialOptions | Yes| Call options. For details, see [DialOptions](#DialOptions).| -| callback | AsyncCallback<boolean> | Yes| Callback used to return the result.
- **true**: success
- **false**: failure| +| phoneNumber | string | Yes | Phone number. | +| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions). | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -78,14 +78,14 @@ Initiates a call. You can set call options as needed. This function uses a promi **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ----------- | ---- | ------------------------------------------- | -| phoneNumber | string | Yes| Phone number.| -| options | DialOptions | Yes| Call options. For details, see [DialOptions](#DialOptions).| +| phoneNumber | string | Yes | Phone number. | +| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions).| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ---------------------- | --------------------------------- | | Promise<boolean> | Promise used to return the result.| @@ -102,6 +102,61 @@ promise.then(data => { }); ``` +## call.makeCall7+ + +makeCall(phoneNumber: string, callback: AsyncCallback): void + +Launches the call screen and displays the dialed number. This method uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Telephony.CallManager + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | ------------------------- | ---- | ------------------------------------------ | +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + +``` +call.makeCall("138xxxxxxxx", err => { + console.log(`makeCall callback: err->${JSON.stringify(err)}`); +}); +``` + + +## call.makeCall7+ + +makeCall(phoneNumber: string): Promise + +Launches the call screen and displays the dialed number. This method uses a promise to return the result. + +**System capability**: SystemCapability.Telephony.CallManager + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | ------ | ---- | ---------- | +| phoneNumber | string | Yes | Phone number.| + +**Return Value** + +| Type | Description | +| ------------------- | --------------------------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + +``` +let promise = call.makeCall("138xxxxxxxx"); +promise.then(() => { + console.log(`makeCall success`); +}).catch(err => { + console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`); +}); +``` + ## call.hasCall hasCall\(callback: AsyncCallback\): void @@ -112,9 +167,9 @@ Checks whether a call is in progress. This function uses an asynchronous callbac **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback<boolean> | Yes| Callback used to return the result:
- **true**: A call is in progress.
- **false**: No call is in progress. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: A call is in progress.
- **false**: No call is in progress.| **Example** @@ -133,9 +188,9 @@ Checks whether a call is in progress. This function uses a promise to return the **System capability**: SystemCapability.Telephony.CallManager -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ---------------------- | --------------------------------------- | | Promise<boolean> | Promise used to return the result.| @@ -161,9 +216,9 @@ Obtains the call status. This function uses an asynchronous callback to return t **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | -------------------------------------------- | ---- | ------------------------------------ | -| callback | AsyncCallback<[CallState](#CallState)> | Yes| Callback used to return the result.| +| callback | AsyncCallback<[CallState](#CallState)> | Yes | Callback used to return the result.| **Example** @@ -182,9 +237,9 @@ Obtains the call status. This function uses a promise to return the result. **System capability**: SystemCapability.Telephony.CallManager -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | -------------------------------------- | ----------------------------------------- | | Promise<[CallState](#CallState)> | Promise used to return the result.| @@ -199,6 +254,25 @@ promise.then(data => { }); ``` +## call.hasVoiceCapability7+ + +hasVoiceCapability(): boolean + +Checks whether a device supports voice calls. This function works in synchronous mode. + +**System capability**: SystemCapability.Telephony.CallManager + +**Return Value** + +| Type | Description | +| ------- | ------------------------------------------------------------ | +| boolean | - **true**: The device supports voice calls.
- **false**: The device does not support voice calls.| + +``` +let result = call.hasVoiceCapability(); +console.log(`hasVoiceCapability: ${JSON.stringify(result)}`); +``` + ## call.isEmergencyPhoneNumber7+ isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback\): void @@ -209,10 +283,10 @@ Checks whether the call number of the SIM card in the specified slot is an emerg **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| callback | AsyncCallback<boolean> | Yes| Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| **Example** @@ -233,11 +307,11 @@ Checks whether the call number of the SIM card in the specified slot is an emerg **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| options | EmergencyNumberOptions | Yes| Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| -| callback | AsyncCallback<boolean> | Yes| Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| +| phoneNumber | string | Yes | Phone number. | +| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| **Example** @@ -258,14 +332,14 @@ Checks whether the call number of the SIM card in the specified slot is an emerg **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ---------------------- | ---- | ------------------------------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| options | EmergencyNumberOptions | Yes| Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| +| phoneNumber | string | Yes | Phone number. | +| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ---------------------- | --------------------------------------------------- | | Promise<boolean> | Promise used to return the result.| @@ -290,10 +364,10 @@ Formats a phone number based on the specified ISO country code. This function us **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| callback | AsyncCallback<string> | Yes| Callback used to return the result.| +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<string> | Yes | Callback used to return the result.| **Example** @@ -314,11 +388,11 @@ Formats a phone number based on specified formatting options. This function uses **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ------------------------------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| options | NumberFormatOptions | Yes| Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| -| callback | AsyncCallback<string> | Yes| Callback used to return the result.| +| phoneNumber | string | Yes | Phone number. | +| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| +| callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -341,14 +415,14 @@ Formats a phone number based on specified formatting options. This function uses **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ------------------- | ---- | ------------------------------------------------------------ | -| phoneNumber | string | Yes| Phone number.| -| options | NumberFormatOptions | Yes| Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| +| phoneNumber | string | Yes | Phone number. | +| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | --------------------- | ------------------------------------------- | | Promise<string> | Promise used to return the result.| @@ -379,11 +453,11 @@ All country codes are supported. **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ----------------------------------------------------- | -| phoneNumber | string | Yes| Phone number.| -| countryCode | string | Yes| Country code, for example, **CN** (China). All country codes are supported.| -| callback | AsyncCallback<string> | Yes| Callback used to return the result.| +| phoneNumber | string | Yes | Phone number. | +| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | +| callback | AsyncCallback<string> | Yes | Callback used to return the result.| **Example** @@ -410,14 +484,14 @@ All country codes are supported. **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------------------------------------- | -| phoneNumber | string | Yes| Phone number.| -| countryCode | string | Yes| Country code, for example, **CN** (China). All country codes are supported.| +| phoneNumber | string | Yes | Phone number. | +| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | --------------------- | ------------------------------------------------------------ | | Promise<string> | Promise used to return the result.| @@ -440,20 +514,20 @@ Provides an option for determining whether a call is a video call. **System capability**: SystemCapability.Telephony.CallManager -| Name| Type| Mandatory| Description| +| Parameter | Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------------------------------------------ | -| extras | boolean | No| Indication of a video call. The options are as follows:
- **true**: video call
- **false**: voice call| +| extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| ## CallState Enumerates call states. -| Variable| Value| Description| +| Variable | Value | Description | | ------------------ | ---- | ------------------------------------------------------------ | -| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_IDLE | 0 | No call is in progress.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.
**System capability**: SystemCapability.Telephony.CallManager| +| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown.
**System capability**: SystemCapability.Telephony.CallManager| +| CALL_STATE_IDLE | 0 | No call is in progress.
**System capability**: SystemCapability.Telephony.CallManager| +| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state.
**System capability**: SystemCapability.Telephony.CallManager| +| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.
**System capability**: SystemCapability.Telephony.CallManager| ## EmergencyNumberOptions7+ @@ -461,9 +535,9 @@ Provides an option for determining whether a number is an emergency number for t **System capability**: SystemCapability.Telephony.CallManager -| Name| Type| Mandatory| Description| +| Parameter | Type | Mandatory| Description | | ------ | ------ | ---- | ------------------------------------------ | -| slotId | number | No| SIM card slot ID.
- **0**: slot 1
- **1**: slot 2| +| slotId | number | No | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| ## NumberFormatOptions7+ @@ -471,6 +545,6 @@ Provides an option for number formatting. **System capability**: SystemCapability.Telephony.CallManager -| Name| Type| Mandatory| Description| +| Parameter | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------------------------------------------------------- | -| countryCode | string | No| Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| +| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| diff --git a/en/application-dev/reference/apis/js-apis-sms.md b/en/application-dev/reference/apis/js-apis-sms.md index b3cca70e284d04d0c3f4ad09dae27a42de549252..dace12194df64d8f84487df590327656f2858bbd 100644 --- a/en/application-dev/reference/apis/js-apis-sms.md +++ b/en/application-dev/reference/apis/js-apis-sms.md @@ -20,11 +20,11 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | -| pdu | Array<number> | Yes| PDU, which is obtained from the received SMS message.| -| specification | string | Yes| SMS protocol type. The options are as follows:
- **3gpp**: GSM/UMTS/LTE SMS
- **3gpp2**: CDMA SMS| -| callback | AsyncCallback<[ShortMessage](#ShortMessage)> | Yes| Callback used to return the result.| +| pdu | Array<number> | Yes | PDU, which is obtained from the received SMS message. | +| specification | string | Yes | SMS protocol type.
- **3gpp**: GSM/UMTS/LTE SMS
- **3gpp2**: CDMA SMS| +| callback | AsyncCallback<[ShortMessage](#ShortMessage)> | Yes | Callback used to return the result. | **Example** @@ -48,14 +48,14 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol. **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ------------- | ------------------- | ---- | ------------------------------------------------------------ | -| pdu | Array<number> | Yes| PDU, which is obtained from the received SMS message.| -| specification | string | Yes| SMS protocol type. The options are as follows:
- **3gpp**: GSM/UMTS/LTE SMS
- **3gpp2**: CDMA SMS| +| pdu | Array<number> | Yes | PDU, which is obtained from the received SMS message. | +| specification | string | Yes | SMS protocol type.
- **3gpp**: GSM/UMTS/LTE SMS
- **3gpp2**: CDMA SMS| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | -------------------------------------------- | --------------------------------- | | Promise<[ShortMessage](#ShortMessage)> | Promise used to return the result.| @@ -85,9 +85,9 @@ Sends an SMS message. **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | -| options | [SendMessageOptions](#SendMessageOptions) | Yes| Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#SendMessageOptions).| +| options | [SendMessageOptions](#SendMessageOptions) | Yes | Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#SendMessageOptions).| **Example** @@ -118,9 +118,9 @@ Obtains the default slot of the SIM card used to send SMS messages. This functio **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | --------------------------- | ---- | ---------------------------------------- | -| callback | AsyncCallback<number> | Yes| Callback used to return the result.
- **0**: slot 1
- **1**: slot 2| +| callback | AsyncCallback<number> | Yes | Callback used to return the result.
- **0**: card slot 1
- **1**: card slot 2| **Example** @@ -139,16 +139,16 @@ Obtains the default slot of the SIM card used to send SMS messages. This functio **System capability**: SystemCapability.Telephony.SmsMms -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | --------------- | ------------------------------------------------------------ | -| Promise | Promise used to return the result.
- **0**: slot 1
- **1**: slot 2| +| Promise | Promise used to return the result.
- **0**: card slot 1
- **1**: card slot 2| **Example** ``` -let promise = call.getDefaultSmsSlotId(); +let promise = sms.getDefaultSmsSlotId(); promise.then(data => { console.log(`getDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`); }).catch(err => { @@ -169,11 +169,11 @@ Sets the short message service center (SMSC) address. This function uses an asyn **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ----------------------------------------- | -| slotId | number | Yes| SIM card slot ID:
- **0**: slot 1
- **1**: slot 2| -| smscAddr | string | Yes| SMSC address. | -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| smscAddr | string | Yes | SMSC address. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -198,14 +198,14 @@ Sets the SMSC address. This function uses a promise to return the result. **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ------ | ---- | ----------------------------------------- | -| slotId | number | Yes| SIM card slot ID:
- **0**: slot 1
- **1**: slot 2| -| smscAddr | string | Yes| SMSC address. | +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| smscAddr | string | Yes | SMSC address. | -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ------------------- | ------------------------------- | | Promise<void> | Promise used to return the result.| @@ -233,12 +233,14 @@ Obtains the SMSC address. This function uses an asynchronous callback to return **System capability**: SystemCapability.Telephony.SmsMms +**Note:** This is a system API and it is used only for system applications. + **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | --------------------------- | ---- | ----------------------------------------- | -| slotId | number | Yes| SIM card slot ID:
- **0**: slot 1
- **1**: slot 2| -| callback | AsyncCallback<string> | Yes| Callback used to return the result.| +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -260,15 +262,17 @@ Obtains the SMSC address. This function uses a promise to return the result. **System capability**: SystemCapability.Telephony.SmsMms +**Note:** This is a system API and it is used only for system applications. + **Parameters** -| Name| Type| Mandatory| Description| +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ----------------------------------------- | -| slotId | number | Yes| SIM card slot ID:
- **0**: slot 1
- **1**: slot 2| +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | --------------------- | --------------------------------------------- | | Promise<string> | Promise used to return the result.| @@ -284,6 +288,24 @@ promise.then(data => { }); ``` +## sms.hasSmsCapability7+ + +hasSmsCapability(): boolean + +Checks whether the current device can send and receive SMS messages. This function works in synchronous mode. + +**System capability**: SystemCapability.Telephony.SmsMms + +**Return Value** + +| Type | Description | +| ------- | ------------------------------------------------------------ | +| boolean | - **true**: The device can send and receive SMS messages.
- **false**: The device cannot send or receive SMS messages.| + +``` +let result = sms.hasSmsCapability(); +console.log(`hasSmsCapability: ${JSON.stringify(result)}`); +``` ## ShortMessage @@ -291,36 +313,32 @@ Defines an SMS message instance. **System capability**: SystemCapability.Telephony.SmsMms -| Variable| Type| Description| +| Variable | Type | Description | | ------------------------ | --------------------------------------- | ------------------------------------------------------------ | -| emailAddress | string | Email address.| -| emailMessageBody | string | Email body.| -| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.
**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.| -| isEmailMessage | boolean | Whether the received SMS message is an email.| -| isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.
For details, see section 9.2.3.9 in **3GPP TS 23.040**.| -| isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.
SMS delivery status report: a message sent from the SMSC to show the current status of the SMS message you delivered.| -| messageClass | [ShortMessageClass](#ShortMessageClass) | SMS message type.| -| pdu | Array<number> | PDU in the SMS message.| -| protocolId | number | ID of the protocol used for sending SMS messages.| -| scAddress | string | Address of the short message service center (SMSC).| -| scTimestamp | number | SMSC timestamp.| +| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.
**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.| +| isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.
For details, see section 9.2.3.9 in **3GPP TS 23.040**.| +| isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.
**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.| +| messageClass | [ShortMessageClass](#ShortMessageClass) | SMS message type. | +| pdu | Array<number> | PDU in the SMS message. | +| protocolId | number | ID of the protocol used for sending SMS messages. | +| scAddress | string | Address of the short message service center (SMSC). | +| scTimestamp | number | SMSC timestamp. | | status | number | SMS message status sent by the SMSC in the **SMS-STATUS-REPORT** message.| -| userRawData | Array<number> | User data except the data header.| -| visibleMessageBody | string | SMS message body.| -| visibleRawAddress | string | Sender address.| +| visibleMessageBody | string | SMS message body. | +| visibleRawAddress | string | Sender address. | ## ShortMessageClass Enumerates SMS message types. -| Variable| Value| Description| +| Variable | Value | Description | | ---------------- | ---- | ------------------------------------------------------------ | -| UNKNOWN | 0 | Unknown type.
**System capability**: SystemCapability.Telephony.SmsMms| -| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received.
**System capability**: SystemCapability.Telephony.SmsMms| -| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| -| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| -| FORWARD_MESSAGE | 4 | Message to be forwarded to another device.
**System capability**: SystemCapability.Telephony.SmsMms| +| UNKNOWN | 0 | Unknown type.
**System capability**: SystemCapability.Telephony.SmsMms| +| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received.
**System capability**: SystemCapability.Telephony.SmsMms| +| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| +| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| +| FORWARD_MESSAGE | 4 | Message to be forwarded to another device.
**System capability**: SystemCapability.Telephony.SmsMms| ## SendMessageOptions @@ -331,15 +349,15 @@ For example, you can specify the SMS message type by the optional parameter **co **System capability**: SystemCapability.Telephony.SmsMms -| Name| Type| Mandatory| Description| +| Parameter | Type | Mandatory| Description | | ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| slotId | number | Yes| Slot ID of the SIM card used for sending SMS messages:
- **0**: slot 1
- **1**: slot 2| -| destinationHost | string | Yes| Destination address of the SMS message.| -| content | string \| Array<number> | Yes| SMS message type. If the content is composed of character strings, the SMS message is a text message. If the content is composed of byte arrays, the SMS message is a data message.| -| serviceCenter | string | No| SMSC address. By default, the SMSC address in the SIM card is used.| -| destinationPort | number | No| Destination port of the SMS message. This parameter is mandatory only for a data message. Otherwise, it is optional.| -| sendCallback | AsyncCallback<[ISendShortMessageCallback](#ISendShortMessageCallback)> | No| Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#ISendShortMessageCallback).| -| deliveryCallback | AsyncCallback<[IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback)> | No| Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback).| +| slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages.
- **0**: card slot 1
- **1**: card slot 2 | +| destinationHost | string | Yes | Destination address of the SMS message. | +| content | string \| Array<number> | Yes | SMS message type. If the content is composed of character strings, the SMS message is a text message. If the content is composed of byte arrays, the SMS message is a data message.| +| serviceCenter | string | No | SMSC address. By default, the SMSC address in the SIM card is used. | +| destinationPort | number | No | Destination port of the SMS message. This parameter is mandatory only for a data message. Otherwise, it is optional. | +| sendCallback | AsyncCallback<[ISendShortMessageCallback](#ISendShortMessageCallback)> | No | Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#ISendShortMessageCallback).| +| deliveryCallback | AsyncCallback<[IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback)> | No | Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback).| ## ISendShortMessageCallback @@ -348,11 +366,11 @@ Provides the callback for the SMS message sending result. It consists of three p **System capability**: SystemCapability.Telephony.SmsMms -| Name| Type| Mandatory| Description| +| Parameter | Type | Mandatory| Description | | ---------- | ------------------------------- | ---- | ------------------------------------------------------------ | -| isLastPart | boolean | No| Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| -| result | [SendSmsResult](#SendSmsResult) | Yes| SMS message sending result.| -| url | string | Yes| URI for storing sent SMS messages.| +| isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| +| result | [SendSmsResult](#SendSmsResult) | Yes | SMS message sending result. | +| url | string | Yes | URI for storing sent SMS messages. | ## IDeliveryShortMessageCallback @@ -361,9 +379,9 @@ Provides the callback for the SMS message sending result. Return the SMS deliver **System capability**: SystemCapability.Telephony.SmsMms -| Name| Type| Mandatory| Description| +| Parameter| Type | Mandatory| Description | | ------ | ------------------- | ---- | -------------- | -| pdu | Array<number> | Yes| SMS message delivery report.| +| pdu | Array<number> | Yes | SMS message delivery report.| ## SendSmsResult @@ -372,9 +390,9 @@ Enumerates SMS message sending results. **System capability**: SystemCapability.Telephony.SmsMms -| Name| Value| Description| +| Parameter | Value | Description | | ------------------------------------ | ---- | ------------------------------------------------------ | -| SEND_SMS_SUCCESS | 0 | SMS message sent successfully.| -| SEND_SMS_FAILURE_UNKNOWN | 1 | Failed to send the SMS message due to unknown reasons.| -| SEND_SMS_FAILURE_RADIO_OFF | 2 | Failed to send the SMS message because the modem is shut down.| +| SEND_SMS_SUCCESS | 0 | SMS message sent successfully. | +| SEND_SMS_FAILURE_UNKNOWN | 1 | Failed to send the SMS message due to unknown reasons. | +| SEND_SMS_FAILURE_RADIO_OFF | 2 | Failed to send the SMS message because the modem is shut down. | | SEND_SMS_FAILURE_SERVICE_UNAVAILABLE | 3 | Failed to send the SMS message because the network is unavailable or SMS message sending or receiving is not supported.|