harmony 鸿蒙Telephony Subsystem Changelog
Telephony Subsystem Changelog
cl.telephony.1 Input Parameter Change of System APIs of the SMS Module
Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, which do not comply with the API specifications of OpenHarmony. The following changes are made in API version 9 and later:
The slotId parameter is added to the isImsSmsSupported API, indicating the slot ID.
Change Impacts
Input parameters of JavaScript APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
Key API/Component Changes
- Involved APIs
isImsSmsSupported(callback: AsyncCallback
- Before change:
function isImsSmsSupported(callback: AsyncCallback<boolean>): void;
function isImsSmsSupported(): Promise<boolean>;
- After change:
function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): void;
function isImsSmsSupported(slotId: number): Promise<boolean>;
Adaptation Guide
Add an input parameter. The sample code is as follows:
Callback mode
let slotId = 0;
sms.isImsSmsSupported(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
Promise mode
let slotId = 0;
let promise = sms.isImsSmsSupported(slotId);
promise.then(data => {
console.log(`isImsSmsSupported success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`);
});
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Distributed Scheduler Subsystem ChangeLog
harmony 鸿蒙Web Subsystem ChangeLog
harmony 鸿蒙Example Subsystem ChangeLog
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦