拉起短信界面并指定联系人参考demo:import common from '@ohos.app.ability.common'; function startMMSAbilityExplicit(): void { let context = getContext(this) as common.UIAbilityContext; let contactInfo = [{ contactsName: 'ZhangSan', telephone: '16888888888' }]; let want = { bundleName: 'com.ohos.mms', abilityName: 'com.ohos.mms.MainAbility', parameters: { contactObjects: JSON.stringify(contactInfo), pageFlag: 'conversation' } }; context.startAbility(want) .then(() => { //... }) .catch((err) => { console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`); }); }
拉起短信界面并指定联系人参考demo: