拉起短息页面可通过startAbility want进行设置,手机号不是必填项,示例如下:let context = getContext(this) as common.UIAbilityContext;let contactInfo: Array<info> = new Array()contactInfo[0] = new info('联系人1', '12345678911');contactInfo[1] = new info('联系人2', '98765432100');let want: Want = {bundleName: 'com.ohos.mms',abilityName: 'com.ohos.mms.MainAbility',parameters: {// contactObjects: JSON.stringify(contactInfo),pageFlag: 'conversation',content: '你好,短信发送给您,请接收。}};context.startAbility(want).then(() => {}).catch((err: BusinessError) => {});
拉起短息页面可通过startAbility want进行设置,手机号不是必填项,示例如下:
let context = getContext(this) as common.UIAbilityContext;
let contactInfo: Array<info> = new Array()
contactInfo[0] = new info('联系人1', '12345678911');
contactInfo[1] = new info('联系人2', '98765432100');
let want: Want = {
bundleName: 'com.ohos.mms',
abilityName: 'com.ohos.mms.MainAbility',
parameters: {
// contactObjects: JSON.stringify(contactInfo),
pageFlag: 'conversation',
content: '你好,短信发送给您,请接收。
}
};
context.startAbility(want).then(() => {
}).catch((err: BusinessError) => {
});