Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
f7352408
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f7352408
编写于
9月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!9602 md文件扫描问题修改
Merge pull request !9602 from dingxiaochen/master
上级
0c6f79ec
f4bbf782
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
109 addition
and
111 deletion
+109
-111
zh-cn/application-dev/reference/apis/js-apis-call.md
zh-cn/application-dev/reference/apis/js-apis-call.md
+15
-19
zh-cn/application-dev/reference/apis/js-apis-contact.md
zh-cn/application-dev/reference/apis/js-apis-contact.md
+8
-8
zh-cn/application-dev/reference/apis/js-apis-radio.md
zh-cn/application-dev/reference/apis/js-apis-radio.md
+12
-12
zh-cn/application-dev/reference/apis/js-apis-sim.md
zh-cn/application-dev/reference/apis/js-apis-sim.md
+39
-39
zh-cn/application-dev/reference/apis/js-apis-sms.md
zh-cn/application-dev/reference/apis/js-apis-sms.md
+35
-33
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-call.md
浏览文件 @
f7352408
...
@@ -319,7 +319,7 @@ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, ca
...
@@ -319,7 +319,7 @@ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, ca
**示例:**
**示例:**
```
js
```
js
call
.
isEmergencyPhoneNumber
(
"
112
"
,
{
slotId
:
1
},
(
err
,
value
)
=>
{
call
.
isEmergencyPhoneNumber
(
"
112
"
,
{
slotId
:
1
},
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -468,9 +468,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: Asy
...
@@ -468,9 +468,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: Asy
**示例:**
**示例:**
```
js
```
js
call
.
formatPhoneNumberToE164
(
"
138xxxxxxxx
"
,{
call
.
formatPhoneNumberToE164
(
"
138xxxxxxxx
"
,
"
CN
"
,
(
err
,
data
)
=>
{
countryCode
:
"
CN
"
},
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -504,9 +502,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<str
...
@@ -504,9 +502,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<str
**示例:**
**示例:**
```
js
```
js
let
promise
=
call
.
formatPhoneNumberToE164
(
"
138xxxxxxxx
"
,
{
let
promise
=
call
.
formatPhoneNumberToE164
(
"
138xxxxxxxx
"
,
"
CN
"
);
countryCode
:
"
CN
"
});
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`formatPhoneNumberToE164 success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`formatPhoneNumberToE164 success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -1703,7 +1699,7 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void
...
@@ -1703,7 +1699,7 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void
**示例:**
**示例:**
```
js
```
js
isNewCallAllowed
call
.
on
(
'
mmiCodeResult
'
,
(
err
,
data
)
=>
{
call
.
on
(
'
mmiCodeResult
'
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2072,10 +2068,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall
...
@@ -2072,10 +2068,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall
**示例:**
**示例:**
```
js
```
js
let
callTransferTyp
=
{
call
.
getCallTransferInfo
(
0
,
call
.
CallTransferType
.
TRANSFER_TYPE_BUSY
,
(
err
,
data
)
=>
{
CallTransferType
:
1
}
call
.
getCallTransferInfo
(
0
,
callTransferTyp
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2107,10 +2100,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
...
@@ -2107,10 +2100,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
**示例:**
**示例:**
```
js
```
js
let
callTransferTyp
=
{
let
promise
=
call
.
getCallTransferInfo
(
0
,
call
.
CallTransferType
.
TRANSFER_TYPE_BUSY
);
CallTransferType
:
1
}
let
promise
=
call
.
getCallTransferInfo
(
0
,
callTransferTyp
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`getCallTransferInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`getCallTransferInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -2399,7 +2389,7 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
...
@@ -2399,7 +2389,7 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
let
audioDeviceOptions
=
{
let
audioDeviceOptions
=
{
bluetoothAddress
:
"
IEEE 802-2014
"
bluetoothAddress
:
"
IEEE 802-2014
"
}
}
call
.
setAudioDevice
(
1
,
bluetoothAddres
s
,
(
err
,
value
)
=>
{
call
.
setAudioDevice
(
1
,
audioDeviceOption
s
,
(
err
,
value
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2463,7 +2453,10 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
...
@@ -2463,7 +2453,10 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
**示例:**
**示例:**
```
js
```
js
call
.
joinConference
(
1
,
"
138XXXXXXXX
"
,
(
err
,
data
)
=>
{
let
callNumberList
:
Array
<
string
>
=
[
"
138XXXXXXXX
"
];
call
.
joinConference
(
1
,
callNumberList
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2494,7 +2487,10 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
...
@@ -2494,7 +2487,10 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
**示例:**
**示例:**
```
js
```
js
let
promise
=
call
.
joinConference
(
1
,
"
138XXXXXXXX
"
);
let
callNumberList
:
Array
<
string
>
=
[
"
138XXXXXXXX
"
];
let
promise
=
call
.
joinConference
(
1
,
callNumberList
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`joinConference success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`joinConference success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
...
zh-cn/application-dev/reference/apis/js-apis-contact.md
浏览文件 @
f7352408
...
@@ -34,7 +34,7 @@ addContact(contact:Contact, callback:AsyncCallback<number>): void
...
@@ -34,7 +34,7 @@ addContact(contact:Contact, callback:AsyncCallback<number>): void
```
js
```
js
contact
.
addContact
({
contact
.
addContact
({
fullN
ame
:
{
fullName
:
'
xxx
'
},
n
ame
:
{
fullName
:
'
xxx
'
},
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
...
@@ -202,7 +202,7 @@ updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallbac
...
@@ -202,7 +202,7 @@ updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallbac
```
js
```
js
contact
.
updateContact
({
contact
.
updateContact
({
fullN
ame
:
{
fullName
:
'
xxx
'
},
n
ame
:
{
fullName
:
'
xxx
'
},
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
},{
},{
attributes
:[
contact
.
Attribute
.
ATTR_EMAIL
,
contact
.
Attribute
.
ATTR_NAME
]
attributes
:[
contact
.
Attribute
.
ATTR_EMAIL
,
contact
.
Attribute
.
ATTR_NAME
]
...
@@ -242,7 +242,7 @@ updateContact(contact: Contact, attrs?: ContactAttributes): Promise<void>
...
@@ -242,7 +242,7 @@ updateContact(contact: Contact, attrs?: ContactAttributes): Promise<void>
```
js
```
js
let
promise
=
contact
.
updateContact
({
let
promise
=
contact
.
updateContact
({
fullN
ame
:
{
fullName
:
'
xxx
'
},
n
ame
:
{
fullName
:
'
xxx
'
},
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
phoneNumbers
:
[{
phoneNumber
:
'
138xxxxxxxx
'
}]
},
{
},
{
attributes
:
[
contact
.
Attribute
.
ATTR_EMAIL
,
contact
.
Attribute
.
ATTR_NAME
]
attributes
:
[
contact
.
Attribute
.
ATTR_EMAIL
,
contact
.
Attribute
.
ATTR_NAME
]
...
@@ -487,7 +487,7 @@ selectContact(callback: AsyncCallback<Array<Contact>>): void
...
@@ -487,7 +487,7 @@ selectContact(callback: AsyncCallback<Array<Contact>>): void
**需要权限**
:ohos.permission.READ_CONTACTS
**需要权限**
:ohos.permission.READ_CONTACTS
**系统能力**
:SystemCapability.Applications.Contacts
、SystemCapability.Applications.Contacts
Data
**系统能力**
:SystemCapability.Applications.ContactsData
**参数:**
**参数:**
...
@@ -1450,7 +1450,7 @@ queryKey(id: number, holder: Holder, callback: AsyncCallback<string>): voi
...
@@ -1450,7 +1450,7 @@ queryKey(id: number, holder: Holder, callback: AsyncCallback<string>): voi
**示例:**
**示例:**
```
js
```
js
contact
.
queryKey
(
id
,
{
contact
.
queryKey
(
/*id*/
1
,
{
holderId
:
0
,
holderId
:
0
,
bundleName
:
""
,
bundleName
:
""
,
displayName
:
""
displayName
:
""
...
@@ -1490,7 +1490,7 @@ queryKey(id: number, holder?: Holder): Promise<string>
...
@@ -1490,7 +1490,7 @@ queryKey(id: number, holder?: Holder): Promise<string>
**示例:**
**示例:**
```
js
```
js
let
promise
=
contact
.
queryKey
(
id
,
{
let
promise
=
contact
.
queryKey
(
/*id*/
1
,
{
holderId
:
0
,
holderId
:
0
,
bundleName
:
""
,
bundleName
:
""
,
displayName
:
""
displayName
:
""
...
@@ -1605,7 +1605,7 @@ let contactAttributes = {
...
@@ -1605,7 +1605,7 @@ let contactAttributes = {
```
js
```
js
let
contactAttributes
=
new
contact
.
ContactAttributes
();
let
contactAttributes
=
new
contact
.
ContactAttributes
();
contactAttributes
.
attributes
=
[
"
ATTR_EMAIL
"
];
contactAttributes
.
attributes
=
[
contact
.
Attribute
.
ATTR_EMAIL
];
```
```
...
...
zh-cn/application-dev/reference/apis/js-apis-radio.md
浏览文件 @
f7352408
...
@@ -1100,12 +1100,12 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCa
...
@@ -1100,12 +1100,12 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCa
let
networkInformation
=
{
let
networkInformation
=
{
operatorName
:
"
中国移动
"
,
operatorName
:
"
中国移动
"
,
operatorNumeric
:
"
898600
"
,
operatorNumeric
:
"
898600
"
,
state
:
1
,
state
:
radio
.
NetworkInformationState
.
NETWORK_AVAILABLE
,
radioTech
:
"
CS
"
radioTech
:
"
CS
"
}
}
let
networkSelectionModeOptions
=
{
let
networkSelectionModeOptions
=
{
slot
i
d
:
0
,
slot
I
d
:
0
,
selectMode
:
1
,
selectMode
:
radio
.
NetworkSelectionMode
.
NETWORK_SELECTION_AUTOMATIC
,
networkInformation
:
networkInformation
,
networkInformation
:
networkInformation
,
resumeSelection
:
true
resumeSelection
:
true
}
}
...
@@ -1144,12 +1144,12 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>
...
@@ -1144,12 +1144,12 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>
let
networkInformation
=
{
let
networkInformation
=
{
operatorName
:
"
中国移动
"
,
operatorName
:
"
中国移动
"
,
operatorNumeric
:
"
898600
"
,
operatorNumeric
:
"
898600
"
,
state
:
1
,
state
:
radio
.
NetworkInformationState
.
NETWORK_AVAILABLE
,
radioTech
:
"
CS
"
radioTech
:
"
CS
"
}
}
let
networkSelectionModeOptions
=
{
let
networkSelectionModeOptions
=
{
slot
i
d
:
0
,
slot
I
d
:
0
,
selectMode
:
1
,
selectMode
:
radio
.
NetworkSelectionMode
.
NETWORK_SELECTION_AUTOMATIC
,
networkInformation
:
networkInformation
,
networkInformation
:
networkInformation
,
resumeSelection
:
true
resumeSelection
:
true
}
}
...
@@ -1190,7 +1190,7 @@ radio.getNetworkSearchInformation(0, (err, data) => {
...
@@ -1190,7 +1190,7 @@ radio.getNetworkSearchInformation(0, (err, data) => {
## radio.getNetworkSearchInformation
## radio.getNetworkSearchInformation
getNetworkSearchInformation
\(
slotId: number
\)
: Promise<
void
\>
getNetworkSearchInformation
\(
slotId: number
\)
: Promise<
NetworkSearchResult
\>
获取网络搜索信息。使用Promise异步回调。
获取网络搜索信息。使用Promise异步回调。
...
@@ -1586,7 +1586,7 @@ radio.getPreferredNetwork(0, (err, data) => {
...
@@ -1586,7 +1586,7 @@ radio.getPreferredNetwork(0, (err, data) => {
## radio.getPreferredNetwork<sup>8+</sup>
## radio.getPreferredNetwork<sup>8+</sup>
getPreferredNetwork(slotId: number): Promise<
void
\>
getPreferredNetwork(slotId: number): Promise<
PreferredNetworkMode
\>
获取首选网络。使用Promise异步回调。
获取首选网络。使用Promise异步回调。
...
@@ -1642,7 +1642,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<I
...
@@ -1642,7 +1642,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<I
**示例:**
**示例:**
```
js
```
js
radio
.
getImsRegInfo
(
0
,
1
,
(
err
,
data
)
=>
{
radio
.
getImsRegInfo
(
0
,
radio
.
ImsServiceType
.
TYPE_VIDEO
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -1675,7 +1675,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
...
@@ -1675,7 +1675,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
**示例:**
**示例:**
```
js
```
js
let
promise
=
radio
.
getImsRegInfo
(
0
,
1
);
let
promise
=
radio
.
getImsRegInfo
(
0
,
radio
.
ImsServiceType
.
TYPE_VIDEO
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`getImsRegInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`getImsRegInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -1707,7 +1707,7 @@ on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback:
...
@@ -1707,7 +1707,7 @@ on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback:
**示例:**
**示例:**
```
js
```
js
radio
.
on
(
'
imsRegStateChange
'
,
0
,
1
,
(
err
,
data
)
=>
{
radio
.
on
(
'
imsRegStateChange
'
,
0
,
radio
.
ImsServiceType
.
TYPE_VIDEO
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -1736,7 +1736,7 @@ off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback
...
@@ -1736,7 +1736,7 @@ off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback
**示例:**
**示例:**
```
js
```
js
radio
.
off
(
'
imsRegStateChange
'
,
0
,
1
,
(
err
,
data
)
=>
{
radio
.
off
(
'
imsRegStateChange
'
,
0
,
radio
.
ImsServiceType
.
TYPE_VIDEO
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
...
zh-cn/application-dev/reference/apis/js-apis-sim.md
浏览文件 @
f7352408
...
@@ -589,7 +589,7 @@ getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): vo
...
@@ -589,7 +589,7 @@ getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): vo
**示例:**
**示例:**
```
js
```
js
sim
.
getActiveSimAccountInfoList
(
0
,
(
err
,
data
)
=>
{
sim
.
getActiveSimAccountInfoList
((
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -710,7 +710,7 @@ setShowName\(slotId: number, name: string,callback: AsyncCallback<void\>\): void
...
@@ -710,7 +710,7 @@ setShowName\(slotId: number, name: string,callback: AsyncCallback<void\>\): void
**示例:**
**示例:**
```
js
```
js
cons
t
name
=
'
中国移动
'
;
le
t
name
=
'
中国移动
'
;
sim
.
setShowName
(
0
,
name
,
(
err
,
data
)
=>
{
sim
.
setShowName
(
0
,
name
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
...
@@ -744,7 +744,7 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
...
@@ -744,7 +744,7 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
**示例:**
**示例:**
```
js
```
js
cons
t
name
=
'
中国移动
'
;
le
t
name
=
'
中国移动
'
;
let
promise
=
sim
.
setShowName
(
0
,
name
);
let
promise
=
sim
.
setShowName
(
0
,
name
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`setShowName success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setShowName success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -1096,9 +1096,9 @@ setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStat
...
@@ -1096,9 +1096,9 @@ setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStat
```
js
```
js
let
lockInfo
=
{
let
lockInfo
=
{
lockType
=
1
,
lockType
:
sim
.
LockType
.
PIN_LOCK
,
password
=
"
1234
"
,
password
=
"
1234
"
,
state
=
0
state
:
sim
.
LockState
.
LOCK_OFF
};
};
sim
.
setLockState
(
0
,
lockInfo
,
(
err
,
data
)
=>
{
sim
.
setLockState
(
0
,
lockInfo
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -1135,9 +1135,9 @@ setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\>
...
@@ -1135,9 +1135,9 @@ setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\>
```
js
```
js
let
lockInfo
=
{
let
lockInfo
=
{
lockType
=
1
,
lockType
:
sim
.
LockType
.
PIN_LOCK
,
password
=
"
1234
"
,
password
=
"
1234
"
,
state
=
0
state
:
sim
.
LockState
.
LOCK_OFF
};
};
let
promise
=
sim
.
setLockState
(
0
,
lockInfo
);
let
promise
=
sim
.
setLockState
(
0
,
lockInfo
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
...
@@ -2236,12 +2236,12 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
...
@@ -2236,12 +2236,12 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
sim
.
addIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
sim
.
addIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2277,12 +2277,12 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
...
@@ -2277,12 +2277,12 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
let
promise
=
sim
.
addIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
);
let
promise
=
sim
.
addIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`addIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`addIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -2315,12 +2315,12 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
...
@@ -2315,12 +2315,12 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
sim
.
delIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
sim
.
delIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2356,12 +2356,12 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
...
@@ -2356,12 +2356,12 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
let
promise
=
sim
.
delIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
);
let
promise
=
sim
.
delIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`delIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`delIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -2394,12 +2394,12 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
...
@@ -2394,12 +2394,12 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
sim
.
updateIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
sim
.
updateIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -2435,12 +2435,12 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
...
@@ -2435,12 +2435,12 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
```
js
```
js
let
diallingNumbersInof
=
{
let
diallingNumbersInof
=
{
alphaTag
=
"
alpha
"
,
alphaTag
:
"
alpha
"
,
number
=
"
138xxxxxxxx
"
,
number
:
"
138xxxxxxxx
"
,
recordNumber
=
123
,
recordNumber
:
123
,
pin2
=
"
1234
"
pin2
:
"
1234
"
};
};
let
promise
=
sim
.
updateIccDiallingNumbers
(
0
,
1
,
diallingNumbersInof
);
let
promise
=
sim
.
updateIccDiallingNumbers
(
0
,
sim
.
ContactType
.
GENERAL_CONTACT
,
diallingNumbersInof
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`updateIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`updateIccDiallingNumbers success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -2602,7 +2602,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<L
...
@@ -2602,7 +2602,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<L
```
js
```
js
let
persoLockInfo
=
{
let
persoLockInfo
=
{
lockType
=
0
,
lockType
=
sim
.
PersoLockType
.
PN_PIN_LOCK
,
password
=
"
1234
"
password
=
"
1234
"
};
};
sim
.
unlockSimLock
(
0
,
persoLockInfo
,
(
err
,
data
)
=>
{
sim
.
unlockSimLock
(
0
,
persoLockInfo
,
(
err
,
data
)
=>
{
...
@@ -2640,7 +2640,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusRespon
...
@@ -2640,7 +2640,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusRespon
```
js
```
js
let
persoLockInfo
=
{
let
persoLockInfo
=
{
lockType
=
0
,
lockType
=
sim
.
PersoLockType
.
PN_PIN_LOCK
,
password
=
"
1234
"
password
=
"
1234
"
};
};
let
promise
=
sim
.
unlockSimLock
(
0
,
persoLockInfo
);
let
promise
=
sim
.
unlockSimLock
(
0
,
persoLockInfo
);
...
...
zh-cn/application-dev/reference/apis/js-apis-sms.md
浏览文件 @
f7352408
...
@@ -397,7 +397,7 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
...
@@ -397,7 +397,7 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
**示例:**
**示例:**
```
js
```
js
string
content
=
"
long message
"
;
let
content
=
"
long message
"
;
sms
.
splitMessage
(
content
,
(
err
,
data
)
=>
{
sms
.
splitMessage
(
content
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
...
@@ -431,7 +431,7 @@ splitMessage(content: string): Promise<Array<string\>>
...
@@ -431,7 +431,7 @@ splitMessage(content: string): Promise<Array<string\>>
**示例:**
**示例:**
```
js
```
js
string
content
=
"
long message
"
;
let
content
=
"
long message
"
;
let
promise
=
sms
.
splitMessage
(
content
);
let
promise
=
sms
.
splitMessage
(
content
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`splitMessage success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`splitMessage success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -463,10 +463,10 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
...
@@ -463,10 +463,10 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
```
js
```
js
let
simMessageOptions
=
{
let
simMessageOptions
=
{
slotId
=
0
,
slotId
:
0
,
smsc
=
"
test
"
,
smsc
:
"
test
"
,
pdu
=
"
xxxxxx
"
,
pdu
:
"
xxxxxx
"
,
status
=
0
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
};
};
sms
.
addSimMessage
(
simMessageOptions
,
(
err
,
data
)
=>
{
sms
.
addSimMessage
(
simMessageOptions
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -502,10 +502,10 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
...
@@ -502,10 +502,10 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
```
js
```
js
let
simMessageOptions
=
{
let
simMessageOptions
=
{
slotId
=
0
,
slotId
:
0
,
smsc
=
"
test
"
,
smsc
:
"
test
"
,
pdu
=
"
xxxxxx
"
,
pdu
:
"
xxxxxx
"
,
status
=
0
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
};
};
let
promise
=
sms
.
addSimMessage
(
simMessageOptions
);
let
promise
=
sms
.
addSimMessage
(
simMessageOptions
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
...
@@ -607,9 +607,9 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
...
@@ -607,9 +607,9 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
```
js
```
js
let
updateSimMessageOptions
=
{
let
updateSimMessageOptions
=
{
slotId
=
0
,
slotId
:
0
,
msgIndex
=
1
,
msgIndex
:
1
,
newStatus
=
0
,
newStatus
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_FREE
,
pdu
=
"
xxxxxxx
"
,
pdu
=
"
xxxxxxx
"
,
smsc
=
"
test
"
smsc
=
"
test
"
};
};
...
@@ -647,9 +647,9 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
...
@@ -647,9 +647,9 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
```
js
```
js
let
updateSimMessageOptions
=
{
let
updateSimMessageOptions
=
{
slotId
=
0
,
slotId
:
0
,
msgIndex
=
1
,
msgIndex
:
1
,
newStatus
=
0
,
newStatus
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_FREE
,
pdu
=
"
xxxxxxx
"
,
pdu
=
"
xxxxxxx
"
,
smsc
=
"
test
"
smsc
=
"
test
"
};
};
...
@@ -749,10 +749,11 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
...
@@ -749,10 +749,11 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
```
js
```
js
let
cbConfigOptions
=
{
let
cbConfigOptions
=
{
slotId
=
0
,
slotId
:
0
,
smsc
=
"
test
"
,
enable
:
true
,
pdu
=
"
xxxxxxxx
"
,
startMessageId
:
100
,
status
=
0
endMessageId
:
200
,
ranType
:
sms
.
RanType
.
TYPE_GSM
};
};
sms
.
setCBConfig
(
cbConfigOptions
,
(
err
,
data
)
=>
{
sms
.
setCBConfig
(
cbConfigOptions
,
(
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -788,13 +789,14 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
...
@@ -788,13 +789,14 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
```
js
```
js
let
cbConfigOptions
=
{
let
cbConfigOptions
=
{
slotId
=
0
,
slotId
:
0
,
smsc
=
"
test
"
,
enable
:
true
,
pdu
=
"
xxxxxxxx
"
,
startMessageId
:
100
,
status
=
0
endMessageId
:
200
,
ranType
:
sms
.
RanType
.
TYPE_GSM
};
};
let
promise
=
sms
.
setCBConfig
(
cbConfigOptions
);
let
promise
=
sms
.
setCBConfig
(
cbConfigOptions
);
promise
.
then
(
data
=>
promise
.
then
(
data
=>
{
console
.
log
(
`setCBConfig success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setCBConfig success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
error
(
`setCBConfig failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`setCBConfig failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
...
@@ -859,7 +861,7 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
...
@@ -859,7 +861,7 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
```
js
```
js
let
slotId
=
0
;
let
slotId
=
0
;
let
promise
=
sms
.
getSmsSegmentsInfo
(
slotId
,
"
message
"
,
false
);
let
promise
=
sms
.
getSmsSegmentsInfo
(
slotId
,
"
message
"
,
false
);
promise
.
then
(
data
=>
promise
.
then
(
data
=>
{
console
.
log
(
`getSmsSegmentsInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`getSmsSegmentsInfo success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
error
(
`getSmsSegmentsInfo failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`getSmsSegmentsInfo failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
...
@@ -886,7 +888,7 @@ isImsSmsSupported(callback: AsyncCallback<boolean\>): void
...
@@ -886,7 +888,7 @@ isImsSmsSupported(callback: AsyncCallback<boolean\>): void
```
js
```
js
sms
.
isImsSmsSupported
((
err
,
data
)
=>
{
sms
.
isImsSmsSupported
((
err
,
data
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
});
});
```
```
...
@@ -1023,7 +1025,7 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
...
@@ -1023,7 +1025,7 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
```
js
```
js
let
mmsFilePathName
=
"
filename
"
;
let
mmsFilePathName
=
"
filename
"
;
let
promise
=
sms
.
getSmscAddr
(
mmsFilePathName
);
let
promise
=
sms
.
decodeMms
(
mmsFilePathName
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`decodeMms success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`decodeMms success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -1092,13 +1094,13 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
...
@@ -1092,13 +1094,13 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
```
js
```
js
let
mmsAcknowledgeInd
=
{
let
mmsAcknowledgeInd
=
{
transactionId
=
"
100
"
,
transactionId
:
"
100
"
,
version
=
0x1
0
,
version
:
sms
.
MmsVersionType
.
MMS_VERSION_1_
0
,
reportAllowed
=
128
reportAllowed
=
sms
.
ReportType
.
MMS_YES
};
};
let
mmsInformation
=
{
let
mmsInformation
=
{
messageType
=
133
,
messageType
:
sms
.
MessageType
.
TYPE_MMS_ACKNOWLEDGE_IND
,
mmsType
=
mmsAcknowledgeInd
mmsType
:
mmsAcknowledgeInd
};
};
let
promise
=
sms
.
encodeMms
(
mmsInformation
);
let
promise
=
sms
.
encodeMms
(
mmsInformation
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录