鸿蒙没有应用下载安装,只支持跳转到应用市场更新
TypeScript
gotoMarket(){
try {
const request: Want = {
parameters: {
// 此处填入要加载的应用包名,例如: bundleName: "com.huawei.hmsapp.appgallery"
bundleName: 'com.huawei.hmos.maps.app'
}
};
productViewManager.loadProduct(getContext(this) as common.UIAbilityContext, request, {
onError: (error: BusinessError) => {
hilog.info(0, 'TAG', `loadProduct onError. code is ${error.code}, message is ${error.message}`);
}
});
} catch (err) {
hilog.error(0, 'TAG', `loadProduct failed. code is ${err.code}, message is ${err.message}`);
}
}