【HarmonyOS】鸿蒙获取appIdentifier,Identifier

【HarmonyOS】鸿蒙获取appIdentifier,Identifier

一、前言

三方后台需要填写的所谓appIdentifier,Identifier信息,其实对应鸿蒙应用的appID。

二、解决方案:

注意,模拟器获取data.signatureInfo.appIndentifer为空。需要使用真机。

dart 复制代码
  import { bundleManager} from '@kit.AbilityKit';


let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO
try {
  bundleManager.getBundleInfoForSelf(bundleFlags).then((data) => {
  	// data.signatureInfo.appIndentifer
    hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully. Data: %{public}s', JSON.stringify(data));
  }).catch((err: BusinessError) => {
    hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed. Cause: %{public}s', err.message);
  });
} catch (err) {
  let message = (err as BusinessError).message;
  hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', message);
}

或者登陆使用华为开发者账号登录 AppGallery Connect

相关推荐
全栈若城1 天前
自定义 TabBar 实战:浮动标签栏与舵式标签栏
harmonyos·harmonyos6·三方库开发
maaath1 天前
【maaath】Flutter for OpenHarmony 学习答题应用实战开发
学习·flutter·华为·harmonyos
李游Leo1 天前
别再拼 JSON 了:HarmonyOS UDMF 跨应用数据流转实践
harmonyos
maaath1 天前
【maaath】Flutter for OpenHarmony 实战:记账理财应用开发指南
flutter·华为·harmonyos
key_3_feng1 天前
鸿蒙6.0地图导航应用(可集成到其他APP)开发方案
华为·harmonyos
UnicornDev1 天前
【HarmonyOS 6】底部悬浮导航的沉浸光感适配(API23)
华为·harmonyos·arkts·鸿蒙·鸿蒙系统
轻口味1 天前
HarmonyOS 6 轻相机应用开发5:实时自动戴眼镜功能实现
数码相机·华为·harmonyos
maaath1 天前
【maaath】Flutter for OpenHarmony 实战:构建跨平台房产租售应用
flutter·华为·harmonyos
骆驼10241 天前
华为AC+FIT AP典型组网部署配置
华为·hcia·ac+ap
枫叶丹41 天前
【HarmonyOS 6.0】Camera Kit白平衡API深度解析:让三方应用真正“掌控”色彩
开发语言·华为·harmonyos·视频编解码