OpenHarmony开发者论坛

标题: createmessage失败 [打印本页]

作者: zhangyuebin    时间: 2023-11-9 18:02
标题: createmessage失败
[md]以下代码:

import sms from '@ohos.telephony.sms';
const specification = '3gpp';
// 以数组的形式显示协议数据单元(PDU),类型为number,例如[0x08, 0x91, ...]
const pdu = [0x08, 0x91];
sms.createMessage(pdu, specification, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
执行时报错,具体内容为:

11-09 13:19:38.235 32707-10393/com.example.myapplication E 01F06/SmsApi: [CreateMessage-(sms_service_proxy.cpp:508)] SmsServiceProxy::CreateMessage fail

11-09 13:19:38.235 32707-10393/com.example.myapplication E 01F06/SmsApi: [CreateMessage-(short_message.cpp:199)] CreateMessage fail errorCode:83886087
请问这该如何解决呢?

[/md]
作者: 论坛小助手    时间: 2023-11-29 19:26
示例代码的问题,目前已更新,重新试一下应该是ok了




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5